quote variables

This commit is contained in:
Asif Bacchus 2019-05-25 12:37:20 -06:00
parent 08ab44ce84
commit fa82cb2ce6

View File

@ -37,7 +37,7 @@ badParam () {
# cleanup # cleanup
cleanup () { cleanup () {
# cleanup 503 if copied # cleanup 503 if copied
if [ $err503Copied -eq 1 ]; then if [ "$err503Copied" -eq 1 ]; then
if ! rm -f "$webroot/$err503File" 2>>"$logFile"; then if ! rm -f "$webroot/$err503File" 2>>"$logFile"; then
printf "${warn}[%s] -- [WARNING] Could not remove 503 error page." \ printf "${warn}[%s] -- [WARNING] Could not remove 503 error page." \
"$(stamp)" >> "$logFile" "$(stamp)" >> "$logFile"
@ -46,7 +46,7 @@ cleanup () {
printf "removed --${norm}\n" >> "$logFile" printf "removed --${norm}\n" >> "$logFile"
fi fi
fi fi
if [ $sqlCopied -eq 1 ]; then if [ "$sqlCopied" -eq 1 ]; then
if ! rm -rf "$sqlDumpDir" 2>>"$logFile"; then if ! rm -rf "$sqlDumpDir" 2>>"$logFile"; then
printf "${warn}[%s] -- [WARNING] Could not remove temporary " \ printf "${warn}[%s] -- [WARNING] Could not remove temporary " \
"$(stamp)" >> "$logFile" "$(stamp)" >> "$logFile"
@ -270,7 +270,7 @@ elif [ ! -d "$seafData" ]; then
badParam dne "(--seafdata default)" "$seafData" badParam dne "(--seafdata default)" "$seafData"
fi fi
# offline backup # offline backup
if [ $offlineBackup -eq 1 ]; then if [ "$offlineBackup" -eq 1 ]; then
if ! systemctl list-unit-files | \ if ! systemctl list-unit-files | \
grep -Eq "^$seafService |^$seafService.service" grep -Eq "^$seafService |^$seafService.service"
then then
@ -282,7 +282,7 @@ if [ $offlineBackup -eq 1 ]; then
fi fi
fi fi
# if 503 functionality is enabled, do 503 related files exist? # if 503 functionality is enabled, do 503 related files exist?
if [ $use503 -eq 1 ]; then if [ "$use503" -eq 1 ]; then
if [ ! -f "$err503Path" ]; then if [ ! -f "$err503Path" ]; then
badParam dne "(--503-path default)" "$err503Path" badParam dne "(--503-path default)" "$err503Path"
elif [ ! -d "$webroot" ]; then elif [ ! -d "$webroot" ]; then
@ -299,7 +299,7 @@ printf "${cyan}[%s] -- [INFO] Log located at ${yellow}%s${cyan} --${norm}\n" \
### 503 functionality ### 503 functionality
if [ $use503 -eq 1 ]; then if [ "$use503" -eq 1 ]; then
printf "${cyan}[%s] -- [INFO] Copying 503 error page to " \ printf "${cyan}[%s] -- [INFO] Copying 503 error page to " \
"$(stamp)" >> "$logFile" "$(stamp)" >> "$logFile"
printf "webroot -- ${norm}\n" >> "$logFile" printf "webroot -- ${norm}\n" >> "$logFile"