c4k-nextcloud/infrastructure/backup/image/resources/start-maintenance.sh

17 lines
421 B
Bash
Raw Normal View History

#!/bin/bash
2023-11-03 10:13:40 +00:00
set -eux pipefail
2021-12-15 12:49:57 +00:00
if [ ! -f "/var/backups/config/config.orig" ]; then
rm -f /var/backups/config/config.orig
cp /var/backups/config/config.php /var/backups/config/config.orig
2021-12-15 12:49:57 +00:00
# put nextcloud in maintenance mode
sed -i "s/);/ \'maintenance\' => true,\n);/g" /var/backups/config/config.php
2021-12-15 12:49:57 +00:00
chown www-data:root /var/backups/config/config.php
touch /var/backups/config/config.php
fi