From d13e31ef1835deaf9e34efff503286d16daec35d Mon Sep 17 00:00:00 2001 From: Danny Date: Wed, 23 May 2018 13:30:19 +0200 Subject: [PATCH] check if running install script as root --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index ce4cb68..55a07c1 100755 --- a/install.sh +++ b/install.sh @@ -7,6 +7,11 @@ set -e # Exit on error SERVER_PORT="9000" # Port for Fathom server +# Check if running as root +if [ "$EUID" -ne 0 ] + then echo "Please run the Fathom installer as root (to install the necessary NGINX & systemd files)" + exit +fi function download_fathom() { # Download latest version of the Fathom application @@ -187,7 +192,7 @@ setup_config # Ask to setup new NGINX server block if [ "$(command -v nginx)" ]; then read -p "NGINX detected. Create a new server block? (Y/n): " CONTINUE - if [ "$CONTINUE" != "n" ]; + if [ "$CONTINUE" != "n" ]; then new_nginx_server fi; fi;