Updated cleanup function to conform with check for webroot vs err503File

This commit is contained in:
Asif Bacchus 2018-10-01 23:33:57 -06:00
parent 1172defe7e
commit bb0c5b2f66
1 changed files with 9 additions and 5 deletions

View File

@ -105,8 +105,9 @@ function cleanup {
fi fi
## remove 503 error page ## remove 503 error page
# check if 503 page was specified to begin with # check if webroot was specified, if not, then nothing was copied so we can
if [ -n "$err503File" ]; then # skip this whole section
if [ -n "$webroot" ]; then
# proceed with cleanup # 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
@ -116,10 +117,13 @@ function cleanup {
# file still exists # file still exists
exitWarn+=('5030') exitWarn+=('5030')
else else
# file removed or was never present # file removed
echo -e "${op}${stamp} 503 page no longer present (successfully" \ echo -e "${info}${stamp} -- [INFO] 503 page removed from webroot" \
"deleted or it never existed)" >> "$logFile" "--${normal}" >> "$logFile"
fi fi
else
echo -e "${op}${stamp} No webroot specified so no 503 file to remove." \
>> "$logFile"
fi fi
} }