addPPA fct bug fixed on search

This commit is contained in:
Francois B 2018-05-04 01:40:19 +02:00
parent 4e0533cb24
commit 65069d9754

View file

@ -237,7 +237,11 @@ function updateSystem () {
function addPPA () { function addPPA () {
typeset ret_code typeset ret_code
if ! grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -q $*; then prefix="ppa:"
str="$*"
str2search=${str#$prefix}
if ! grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* | grep -q ${str2search}; then
printf "[PPA] adding : $* " printf "[PPA] adding : $* "
printf "\n[PPA] adding $*\n" &>> $logFile printf "\n[PPA] adding $*\n" &>> $logFile
sudo add-apt-repository -y $* &>> $logFile sudo add-apt-repository -y $* &>> $logFile