From c7ea64cd924e7f2dc18233a76f438e61ee3ab49b Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sun, 6 Jan 2019 01:26:44 -0700 Subject: [PATCH] added root check --- .vscode/numbered-bookmarks.json | 4 ++-- setup.sh | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.vscode/numbered-bookmarks.json b/.vscode/numbered-bookmarks.json index 80980ce..b1d020c 100644 --- a/.vscode/numbered-bookmarks.json +++ b/.vscode/numbered-bookmarks.json @@ -6,13 +6,13 @@ -1, 30, 43, + 668, -1, -1, -1, -1, -1, - 659, - 625 + -1 ] } ] diff --git a/setup.sh b/setup.sh index 45701f7..acbebff 100755 --- a/setup.sh +++ b/setup.sh @@ -62,6 +62,15 @@ tag_phpAddr="" tag_phpPort="" tag_phpVersion="" + + +### check running as root, otherwise exit +if [ $(id -u) -ne 0 ]; then + echo -e "\n${err}This script MUST be run as ROOT. Exiting.${norm}" + exit 2 +fi + + ### quick intro for the user echo -e "\n${mag}This script will customize the provided NGINX template files for your" echo "environment. You will be prompted for all necessary information. After that,"