Skip to content

Commit

Permalink
Disable maintenance mode if active during occ
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Hansson <[email protected]>
  • Loading branch information
enoch85 authored Jul 28, 2023
1 parent 23499b7 commit 9e0245a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,18 @@ fi

# Example: nextcloud_occ 'maintenance:mode --on'
nextcloud_occ() {
# Disable maintenance mode if enabled to be able to perform db task and notify
if sudo -u www-data php "$NCPATH"/occ maintenance:mode | grep enabled
then
sudo -u www-data php "$NCPATH"/occ maintenance:mode --off
MMODE=enabled
fi
check_command sudo -u www-data php "$NCPATH"/occ "$@";
if [ -n "$MMODE" ]
then
sudo -u www-data php "$NCPATH"/occ maintenance:mode --on
unset MMODE
fi
}

# Example: nextcloud_occ_no_check 'maintenance:mode --on'
Expand Down

0 comments on commit 9e0245a

Please sign in to comment.