From 757e1c1367a01be4d2dd543f6d30cad7f5b61b3d Mon Sep 17 00:00:00 2001 From: Foxly IT Blog <81775975+foxly-it@users.noreply.github.com> Date: Thu, 15 Jul 2021 09:22:40 +0200 Subject: [PATCH] Update backup.sh added check for root --- backup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backup.sh b/backup.sh index 9a3fcaa..2e2c27c 100644 --- a/backup.sh +++ b/backup.sh @@ -27,6 +27,14 @@ clpLocation="/home/cloudpanel/htdocs/" 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 echo "\n###### Aktiviere Wartungsmodus: ${currentDateReadable} ######\n" sudo -u $user php$phpversion $clpLocation$domain/occ maintenance:mode --on