Update backup.sh

added check for root
This commit is contained in:
Foxly IT Blog 2021-07-15 09:22:40 +02:00 committed by GitHub
parent 90463e49e5
commit 757e1c1367
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,14 @@ clpLocation="/home/cloudpanel/htdocs/"
user="clp" user="clp"
# #
# Check for root
#
if [ "$(id -u)" != "0" ]
then
errorecho "ERROR: This script has to be run as root!"
exit 1
fi
# Nextcloud Maintenance aktivieren # Nextcloud Maintenance aktivieren
echo "\n###### Aktiviere Wartungsmodus: ${currentDateReadable} ######\n" echo "\n###### Aktiviere Wartungsmodus: ${currentDateReadable} ######\n"
sudo -u $user php$phpversion $clpLocation$domain/occ maintenance:mode --on sudo -u $user php$phpversion $clpLocation$domain/occ maintenance:mode --on