From 9723c4abc9d554b64fe22b1541148ddc554f0e2c Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Fri, 16 Nov 2012 15:34:44 +0100 Subject: [PATCH] don't let the install script run as root user --- script/install.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script/install.sh b/script/install.sh index 0ae89f9fe..822a68456 100755 --- a/script/install.sh +++ b/script/install.sh @@ -180,6 +180,13 @@ interactive_check() { fi } +# check if this script is run as root +root_check() { + if [ `id -u` -eq 0 ] ; then + error "don't run this script as root!" + fi +} + # check if all necessary binaries are available binaries_check() { for exe in "${!BINARIES[@]}"; do @@ -447,6 +454,7 @@ prepare_gem_bundle() { #### #### #interactive_check +root_check # display a nice welcome message