From 186beba0e95fa34f71ccf2e28d60ea27f2f730a3 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 2 Aug 2020 01:49:03 +0200 Subject: [PATCH] check if user is root in v-get-database-credentials-of-domain --- bin/v-get-database-credentials-of-domain | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/v-get-database-credentials-of-domain b/bin/v-get-database-credentials-of-domain index 811527ca..60164226 100644 --- a/bin/v-get-database-credentials-of-domain +++ b/bin/v-get-database-credentials-of-domain @@ -9,6 +9,12 @@ # Variable&Function # #----------------------------------------------------------# +whoami=$(whoami) +if [ "$whoami" != "root" ]; then + echo "You must be root to execute this script" + exit 1 +fi + # Argument definition DOMAIN=$1 SUBFOLDER=''