Rewrote 503 removal section to use checkExist

This commit is contained in:
Asif Bacchus 2018-09-06 04:19:11 -06:00
parent b9a3948372
commit c3d25c391d

View File

@ -382,15 +382,20 @@ 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
echo -e "\e[1;36m[`date +%Y-%m-%d` `date +%H:%M:%S`] Removing 503 error page" \ echo -e "\e[1;36m[`date +%Y-%m-%d` `date +%H:%M:%S`] Removing 503 error page" \
"from webroot...\e[0m" >> $logFile "from webroot...\e[0m" | tee -a $logFileVerbose $logFileNormal > /dev/null
rm -f "$webroot/$err503FileName" &>> $logFile rm -f "$webroot/$err503FileName" 2>&1 | tee -a $logFileVerbose $logFileNormal \
> /dev/null
echo -e "\e[0;36m...done\e[0m"
# verify actually removed # verify actually removed
if [ -e "$webroot/$err503FileName" ]; then checkExist find "" "$webroot/$err503FileName"
echo -e "\e[1;33m[`date +%Y-%m-%d` `date +%H:%M:%S`] --Warning--" \ checkResult="$?"
"Error removing 503 error page from webroot." >> $logFile if [ "$checkResult" = "0" ]; then
echo -e "--Warning-- NGINX will NOT server webclients until this file is" \ echo -e "\e[1;33m[`date +%Y-%m-%d` `date +%H:%M:%S`] --WARNING:" \
"removed.\e[0m" >> $logFile "Problem encountered removing 503 error page from webroot." \
"Manually remove this file to allow NGINX to serve web" \
"clients.--" >> $logFile
echo -e "Script will continue processing..." >> $logFile echo -e "Script will continue processing..." >> $logFile
exitWarning+=('103')
else else
echo -e "\e[0;36m...done\e[0m" >> $logFile echo -e "\e[0;36m...done\e[0m" >> $logFile
fi fi