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
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
### quit -- exit the script after logging any errors, warnings, etc. and
|
### quit -- exit the script after logging any errors, warnings, etc.
|
||||||
### cleaning up as necessary
|
|
||||||
function quit {
|
function quit {
|
||||||
# list generated warnings, if any
|
# list generated warnings, if any
|
||||||
if [ ${#exitWarn[@]} -gt 0 ]; then
|
if [ ${#exitWarn[@]} -gt 0 ]; then
|
||||||
@ -71,6 +70,25 @@ function checkExist {
|
|||||||
fi
|
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 ###
|
### End of Functions ###
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user