New branch: 503 section now based on webroot not err503File existance.

Finished check for webroot.
This commit is contained in:
Asif Bacchus 2018-10-01 23:02:52 -06:00
parent d8ed05ae08
commit 0e2fa901f1

View File

@ -231,14 +231,32 @@ echo -e "${info}${stamp} -- [INFO] mySQL dump file will be stored" \
"at: ${lit}${sqlDumpDir}/${sqlDumpFile}${normal}" >> "$logFile" "at: ${lit}${sqlDumpDir}/${sqlDumpFile}${normal}" >> "$logFile"
### 503 error page ### 503 error page: If you dont' plan on using the auto-copied 503 then comment
### this entire section starting with '--- Begin 503 section ---' until
### '--- End 503 section ---' to suppress generated warnings
# Verify 503 existance ### --- Begin 503 section ---
if [ -z "$err503File" ]; then
# no 503 file has been provided ## Check if webroot has been specified, if not, skip this entire section since there is nowhere to copy the 503 file.
echo -e "${info}${stamp} -- [INFO] ${warn503} --${normal}" >> "$logFile" if [ -z "$webroot" ]; then
exitWarn+=('5031') # no webroot path provided
echo -e "${info}${stamp} -- [INFO] ${warn503} --${normal}" \
>> "$logFile"
exitWarn+=('5033')
else else
# verify webroot actually exists
checkExist fd "$webroot"
checkResult="$?"
if [ "$checkResult" = "1" ]; then
# webroot directory specified could not be found
echo -e "${info}${stamp} -- [INFO] ${warn503} --${normal}" \
>> "$logFile"
exitWarn+=('5034')
else
# webroot exists
echo -e "${op}${stamp} Using webroot: ${lit}${webroot}${normal}" \
>> "$logFile"
# Verify 503 existance
checkExist ff "$err503File" checkExist ff "$err503File"
checkResult="$?" checkResult="$?"
if [ "$checkResult" = "1" ]; then if [ "$checkResult" = "1" ]; then
@ -247,13 +265,6 @@ else
>> "$logFile" >> "$logFile"
exitWarn+=('5032') exitWarn+=('5032')
else else
# 503 file found
# verify webroot exists
if [ -z "$webroot" ]; then
# no webroot path provided
echo -e "${info}${stamp} -- [INFO] ${warn503} --${normal}" \
>> "$logFile"
exitWarn+=('5033')
else else
# verify provided webroot path exists # verify provided webroot path exists
checkExist fd "$webroot" checkExist fd "$webroot"