Added error-check for maint. mode

This commit is contained in:
Asif Bacchus 2018-09-04 20:28:52 -06:00
parent 67642ab276
commit 0f80a3b466

View File

@ -173,7 +173,19 @@ else
fi fi
## Put NextCloud in maintenance mode ## Put NextCloud in maintenance mode
echo -e "\e[1;36m[`date +%Y-%m-%d` `date +%H:%M:%S`] Putting NextCloud" \
"in maintenance mode..." >> $logFile
sudo -u ${webUser} php "${ncroot}/occ maintenance:mode --on" 2>> $logFile sudo -u ${webUser} php "${ncroot}/occ maintenance:mode --on" 2>> $logFile
# verify
if [ "$?" = "0" ]; then
echo -e "\e[0;36m...done\e[0m" >> $logFile
else
echo -e "\e[1;33m--Warning-- There was a problem putting NextCloud" \
"into maintenance mode" >> $logFile
echo -e "\e[1;39mScript will continue..." >> $logFile
fi
## Read sqlDetails file and extract necessary information ## Read sqlDetails file and extract necessary information
mapfile -t sqlParams < $sqlDetails mapfile -t sqlParams < $sqlDetails