Setup array variable for exitWarnings

This commit is contained in:
Asif Bacchus 2018-09-06 04:00:11 -06:00
parent 5a6d287d94
commit 934abe56dd
1 changed files with 6 additions and 7 deletions

View File

@ -170,7 +170,7 @@ function checkExist {
elif [ "$2" = "warn" ]; then elif [ "$2" = "warn" ]; then
echo -e "\e[1;33m[`date +%Y-%m-%d` `date +%H:%M:%S`] --WARNING:" \ echo -e "\e[1;33m[`date +%Y-%m-%d` `date +%H:%M:%S`] --WARNING:" \
"${3} was not found--\e[0m" >> $logFile "${3} was not found--\e[0m" >> $logFile
exitWarning=101 exitWarning+=('101')
return 2 return 2
elif [ "$2" = "error" ]; then elif [ "$2" = "error" ]; then
echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] --ERROR:" \ echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] --ERROR:" \
@ -199,6 +199,7 @@ echo -e "\e[1;32m[`date +%Y-%m-%d` `date +%H:%M:%S`]" \
## Parse supplied variables and determine additional script vars ## Parse supplied variables and determine additional script vars
scriptPath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" scriptPath="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
err503FullPath="$scriptPath/$err503FileName" err503FullPath="$scriptPath/$err503FileName"
exitWarning=()
## Determine verbosity level for logging ## Determine verbosity level for logging
if [ "$1" = "verbose" ]; then if [ "$1" = "verbose" ]; then
@ -370,12 +371,10 @@ sudo -u ${webUser} php ${ncroot}/occ maintenance:mode --off >> $logFile 2>&1
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
echo -e "\e[0;36m...done\e[0m" >> $logFile echo -e "\e[0;36m...done\e[0m" >> $logFile
else else
echo -e "\e[1;31m--Error-- There was a problem taking NextCloud" \ echo -e "\e[1;31m--WARNING-- There was a problem taking NextCloud" \
"out of maintenance mode" >> $logFile "out of maintenance mode. This MUST be done manually before" \
echo -e "This MUST be done manually or NextCloud will not" \ "NextCloud can be used." >> $logFile
"function!\e[0m" >> $logFile exitWarning+=('501')
echo -e "\e[4;31mScript aborted\e[0;31m.\e[0m" >> $logFile
exit 101
fi fi
## Remove 503 error page from webroot so NGINX serves web clients again ## Remove 503 error page from webroot so NGINX serves web clients again