quoted webuser variable in ncMain fcn to prevent globbing

This commit is contained in:
Asif Bacchus 2018-10-03 12:59:06 -06:00
parent ed77963bd0
commit b7a04a9422

View File

@ -74,14 +74,14 @@ function ncMaint {
if [ "$1" = "on" ]; then if [ "$1" = "on" ]; then
echo -e "${info}${stamp} -- [INFO] Putting NextCloud in maintenance" \ echo -e "${info}${stamp} -- [INFO] Putting NextCloud in maintenance" \
"mode --${normal}" >> "$logFile" "mode --${normal}" >> "$logFile"
su -c "php ${ncRoot}/occ maintenance:mode --on" - ${webUser} \ su -c "php ${ncRoot}/occ maintenance:mode --on" - "${webUser}" \
>> "$logFile" 2>&1 >> "$logFile" 2>&1
maintResult="$?" maintResult="$?"
return "$maintResult" return "$maintResult"
elif [ "$1" = "off" ]; then elif [ "$1" = "off" ]; then
echo -e "${info}${stamp} -- [INFO] Exiting NextCloud maintenance" \ echo -e "${info}${stamp} -- [INFO] Exiting NextCloud maintenance" \
"mode --${normal}" >> "$logFile" "mode --${normal}" >> "$logFile"
su -c "php ${ncRoot}/occ maintenance:mode --off" - ${webUser} \ su -c "php ${ncRoot}/occ maintenance:mode --off" - "${webUser}" \
>> "$logFile" 2>&1 >> "$logFile" 2>&1
maintResult="$?" maintResult="$?"
return "$maintResult" return "$maintResult"