sunetdrive/templates/scriptreceiver/maintenancemode.erb.sh

13 lines
365 B
Bash
Raw Normal View History

2023-02-13 09:44:56 +00:00
#!/bin/bash
state=${1}
if ! [[ ${state} =~ ^(on|off)$ ]]; then
echo "Usage: ${0} <on|off>"
exit 1
fi
for container in $(docker ps | grep docker.sunet.se/drive/nextcloud-custom | grep -v cron | awk '{print $NF}'); do
docker exec -ti ${container} su - www-data -s /bin/bash -c "php --define apc.enable_cli=1 /var/www/html/occ maintenance:mode --${state}"
done