A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys, Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun VPN routing, and a web dashboard to manage it all. Free & open forever to self-host; optional paid hosted services fund it. See PROMISE.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
22 lines
731 B
Bash
22 lines
731 B
Bash
#!/bin/bash
|
|
|
|
# Flip Nextcloud's maintenance mode. With maintenance on, all users are locked
|
|
# out and Nextcloud only serves a notice — required before running occ upgrades.
|
|
|
|
appNextcloudToggleMaintenance() {
|
|
local args="$1"
|
|
local enable
|
|
enable="$(authToolArg "$args" enable)"
|
|
|
|
local target=--off
|
|
[[ "$enable" == "true" ]] && target=--on
|
|
|
|
local out
|
|
out=$(sudo docker exec -u www-data nextcloud-service php occ maintenance:mode $target 2>&1)
|
|
if echo "$out" | grep -qi "maintenance mode (enabled\|already enabled\|disabled\|already disabled)"; then
|
|
isSuccessful "Nextcloud maintenance mode $target."
|
|
return 0
|
|
fi
|
|
isError "Nextcloud maintenance toggle failed: $out"; return 1
|
|
}
|