Added ncMaint function
This commit is contained in:
parent
a7e410970d
commit
a4894e39f2
22
backup.sh
22
backup.sh
@ -23,8 +23,7 @@ function scriptHelp {
|
||||
exit 1
|
||||
}
|
||||
|
||||
### quit -- exit the script after logging any errors, warnings, etc. and
|
||||
### cleaning up as necessary
|
||||
### quit -- exit the script after logging any errors, warnings, etc.
|
||||
function quit {
|
||||
# list generated warnings, if any
|
||||
if [ ${#exitWarn[@]} -gt 0 ]; then
|
||||
@ -71,6 +70,25 @@ function checkExist {
|
||||
fi
|
||||
}
|
||||
|
||||
### ncMaint - perform NextCloud maintenance mode entry and exit
|
||||
function ncMaint {
|
||||
if [ "$1" = "on" ]; then
|
||||
echo -e "${bold}${cyan}${stamp}Putting NextCloud in maintenance" \
|
||||
"mode..." >> "$logFile"
|
||||
su -c "php ${ncRoot}/occ maintenance:mode --on" - ${webUser} \
|
||||
>> "$logFile" 2>&1
|
||||
maintResult="$?"
|
||||
return "$maintResult"
|
||||
elif [ "$1" = "off" ]; then
|
||||
echo -e "${bold}${cyan}${stamp}Exiting NextCloud maintenance mode..." \
|
||||
>> "$logFile"
|
||||
su -c "php ${ncRoot}/occ maintenance:mode --off" - ${webUser} \
|
||||
>> "$logFile" 2>&1
|
||||
maintResult="$?"
|
||||
return "$maintResult"
|
||||
fi
|
||||
}
|
||||
|
||||
### End of Functions ###
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user