fct update fixed + cosmetic changes

This commit is contained in:
Francois B 2018-03-14 12:10:56 +01:00
parent 748a6c7403
commit 2cc3c26b10

View file

@ -112,28 +112,32 @@ function updateSystem () {
sudo apt-get update &>> $logFile sudo apt-get update &>> $logFile
ret_code=$? ret_code=$?
retCode $ret_code retCode $ret_code
printf "\n"
printf "[APT] upgrade " printf "[APT] upgrade "
printf "\n[APT] upgrade\n" &>> $logFile printf "\n[APT] upgrade\n" &>> $logFile
sudo apt-get -y upgrade &>> $logFile sudo apt-get -y upgrade &>> $logFile
ret_code=$? ret_code=$?
retCode $ret_code retCode $ret_code
printf "\n"
printf "[APT] dist-upgrade " printf "[APT] dist-upgrade "
printf "\n[APT] dist-upgrade\n" &>> $logFile printf "\n[APT] dist-upgrade\n" &>> $logFile
sudo apt-get -y dist-upgrade &>> $logFile sudo apt-get -y dist-upgrade &>> $logFile
ret_code=$? ret_code=$?
retCode $ret_code retCode $ret_code
printf "\n"
if ! which snap >/dev/null; then
printf "[ERR] snap not found, installing...\n"
printf "\n[ERR] snap not found, installing...\n" &>> $logFile
installPackage apt "snapd"
ret_code=$?
if [ $ret_code == 0 ]; then
printf "[SNAP] refresh " printf "[SNAP] refresh "
printf "\n[SNAP] refresh\n" &>> $logFile printf "\n[SNAP] refresh\n" &>> $logFile
sudo snap refresh &>> $logFile sudo snap refresh &>> $logFile
ret_code=$? ret_code=$?
retCode $ret_code retCode $ret_code
printf "\n" fi
fi
repoAdded=0 repoAdded=0
} }
@ -269,7 +273,6 @@ function installPackage () {
sudo apt-get install -fy $pkg &>> $logFile sudo apt-get install -fy $pkg &>> $logFile
ret_code=$? ret_code=$?
retCode $ret_code retCode $ret_code
printf "\n"
;; ;;
"pip") "pip")
if which pip3 >/dev/null; then if which pip3 >/dev/null; then
@ -278,7 +281,6 @@ function installPackage () {
sudo -H pip3 install --upgrade $pkg &>> $logFile sudo -H pip3 install --upgrade $pkg &>> $logFile
ret_code=$? ret_code=$?
retCode $ret_code retCode $ret_code
printf "\n"
else else
printf "[ERR] pip3 not found, installing...\n" printf "[ERR] pip3 not found, installing...\n"
printf "\n[ERR] pip3 not found, installing...\n" &>> $logFile printf "\n[ERR] pip3 not found, installing...\n" &>> $logFile
@ -294,7 +296,6 @@ function installPackage () {
sudo npm install -g $pkg &>> $logFile sudo npm install -g $pkg &>> $logFile
ret_code=$? ret_code=$?
retCode $ret_code retCode $ret_code
printf "\n"
else else
printf "[ERR] npm not found, installing...\n" printf "[ERR] npm not found, installing...\n"
printf "\n[ERR] npm not found, installing...\n" &>> $logFile printf "\n[ERR] npm not found, installing...\n" &>> $logFile
@ -308,7 +309,6 @@ function installPackage () {
sudo gem install $pkg &>> $logFile sudo gem install $pkg &>> $logFile
ret_code=$? ret_code=$?
retCode $ret_code retCode $ret_code
printf "\n"
else else
printf "[ERR] gem not found, installing...\n" printf "[ERR] gem not found, installing...\n"
printf "\n[ERR] gem not found, installing...\n" &>> $logFile printf "\n[ERR] gem not found, installing...\n" &>> $logFile
@ -322,7 +322,6 @@ function installPackage () {
sudo snap install $pkg --classic &>> $logFile sudo snap install $pkg --classic &>> $logFile
ret_code=$? ret_code=$?
retCode $ret_code retCode $ret_code
printf "\n"
else else
printf "[ERR] snap not found, installing...\n" printf "[ERR] snap not found, installing...\n"
printf "\n[ERR] snap not found, installing...\n" &>> $logFile printf "\n[ERR] snap not found, installing...\n" &>> $logFile