From 7eb93a1028249d8bae739578b89215ef5a90ba01 Mon Sep 17 00:00:00 2001 From: Daniel Schubert Date: Fri, 13 Dec 2019 20:07:39 +0000 Subject: [PATCH] Added check for root --- wp-setup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-setup.sh b/wp-setup.sh index d200724..e7c12db 100644 --- a/wp-setup.sh +++ b/wp-setup.sh @@ -12,6 +12,12 @@ set -u # The Wordpress Site is then available at localhost/YOUR_SITENAME # user: admin pw: admin ( change !! ) + +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root" + exit 1 +fi + if [[ $# -eq 0 ]] ; then echo 'Site name required. Exiting ......' exit 1