Added cleanup skip 503 if null

This commit is contained in:
Asif Bacchus 2018-09-30 20:00:39 -06:00
parent 1d8909dbe0
commit 370d9d34a7

View File

@ -89,7 +89,7 @@ function ncMaint {
### cleanup - cleanup files and directories created by this script ### cleanup - cleanup files and directories created by this script
function cleanup { function cleanup {
# remove SQL dump file and directory ## remove SQL dump file and directory
rm -rf "$sqlDumpDir" >> "$logFile" 2>&1 rm -rf "$sqlDumpDir" >> "$logFile" 2>&1
# verify directory is gone # verify directory is gone
checkExist fd "$sqlDumpDir" checkExist fd "$sqlDumpDir"
@ -103,7 +103,10 @@ function cleanup {
>> "$logFile" >> "$logFile"
fi fi
# remove 503 error page ## remove 503 error page
# check if 503 page was specified to begin with
if [ -n "$err503File" ]; then
# proceed with cleanup
rm -f "$webroot/$err503File" >> "$logFile" 2>&1 rm -f "$webroot/$err503File" >> "$logFile" 2>&1
# verify file is actually gone # verify file is actually gone
checkExist ff "$webroot/$err503File" checkExist ff "$webroot/$err503File"
@ -113,8 +116,9 @@ function cleanup {
exitWarn+=('5030') exitWarn+=('5030')
else else
# file removed # file removed
echo -e "${bold}${cyan}${stamp} Removed 503 error page from webroot" \ echo -e "${bold}${cyan}${stamp} Removed 503 error page" \
"${normal}" >> "$logFile" "from webroot${normal}" >> "$logFile"
fi
fi fi
} }