Updated variable name from 503Location to location503

This commit is contained in:
Asif Bacchus 2018-09-19 22:48:00 -06:00
parent afe0440020
commit b0cfd1c1e7
2 changed files with 7 additions and 10 deletions

View File

@ -1,5 +1,2 @@
[2018-09-19 16:00:05]-- Start backup.sh execution --- [2018-09-19 22:46:40] -- [ERROR] Script exited with code 2 --
[2018-09-19 16:08:48] -- [ERROR] Script exited with code 2 --
This script MUST be run as ROOT.
[2018-09-19 16:21:08] -- [ERROR] Script exited with code 2 --
This script MUST be run as ROOT. This script MUST be run as ROOT.

View File

@ -88,7 +88,7 @@ unset logFileVerbose
unset borgCreateParams unset borgCreateParams
unset borgPruneParams unset borgPruneParams
unset sqlDumpDir unset sqlDumpDir
unset 503Location unset location503
unset webroot unset webroot
errorExplain=() errorExplain=()
exitWarn=() exitWarn=()
@ -132,7 +132,7 @@ while getopts ':l:nv5:w:' PARAMS; do
;; ;;
5) 5)
# 503 error page location # 503 error page location
503Location="${OPTARG}" location503="${OPTARG}"
;; ;;
w) w)
# path to webroot for NextCloud installation # path to webroot for NextCloud installation
@ -187,13 +187,13 @@ echo -e "${normal}${stamp} mySQL dump file will be stored at:" \
### 503 error page ### 503 error page
# Verify 503 existance # Verify 503 existance
if [ -z "$503Location" ]; then if [ -z "$location503" ]; then
# no 503 file has been provided # no 503 file has been provided
echo -e "${bold}${yellow}${stamp} -- [WARNING] ${warningExplain[5031]}" \ echo -e "${bold}${yellow}${stamp} -- [WARNING] ${warningExplain[5031]}" \
"--${normal}" >> "$logFile" "--${normal}" >> "$logFile"
exitWarn+=('5031') exitWarn+=('5031')
else else
checkExist ff "$503Location" checkExist ff "$location503"
checkResult="$?" checkResult="$?"
if [ "$checkResult" = "1" ]; then if [ "$checkResult" = "1" ]; then
# 503 file specified could not be found # 503 file specified could not be found
@ -202,7 +202,7 @@ else
exitWarn+=('5032') exitWarn+=('5032')
else else
# 503 file found # 503 file found
echo -e "${bold}${stamp}Found: ${yellow}${503Location}${normal}" \ echo -e "${bold}${stamp}Found: ${yellow}${location503}${normal}" \
>> "$logFileVerbose" >> "$logFileVerbose"
# verify webroot exists # verify webroot exists
@ -224,7 +224,7 @@ else
# webroot exists and 503 exists, copy 503 to webroot # webroot exists and 503 exists, copy 503 to webroot
echo -e "${bold}${cyan}${stamp} Copying 503 error page to" \ echo -e "${bold}${cyan}${stamp} Copying 503 error page to" \
"webroot...${normal}" >> "$logFileVerbose" "webroot...${normal}" >> "$logFileVerbose"
cp "${503Location}" "$webroot/" >> "$logFileVerbose" 2>&1 cp "${location503}" "$webroot/" >> "$logFileVerbose" 2>&1
copyResult="$?" copyResult="$?"
# verify copy was successful # verify copy was successful
if [ "$copyResult" = "1" ]; then if [ "$copyResult" = "1" ]; then