Created
February 2, 2020 16:04
-
-
Save rjmoggach/cfe57d363094fc778b6ec610fcbab7b2 to your computer and use it in GitHub Desktop.
NextCloud Toggle Maintenance Mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function get_maint() { | |
echo `sudo -u www-data php /var/www/nextcloud/occ maintenance:mode` | |
} | |
function set_maint() { | |
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on | |
} | |
function unset_maint() { | |
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off | |
} | |
if [[ `get_maint` =~ "disabled" ]]; then | |
set_maint | |
else | |
unset_maint | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment