From e8e2e08b586453cf88d32d7e71093852f085d6b6 Mon Sep 17 00:00:00 2001 From: "Chris A. Taylor" Date: Mon, 18 Feb 2013 10:47:13 -0800 Subject: [PATCH] Do not allow script to run as root --- install.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install.sh b/install.sh index c44fcf17..3d0cf01b 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,11 @@ #!/usr/bin/env bash +# Make sure we are not running as root +if [[ $EUID -eq 0 ]]; then + echo "This script should not be run as root" 1>&2 + exit 1 +fi + BASIL_ROOT=$(cd -P $(dirname "$0") && pwd) if [[ -z "$BASH_VERSION" ]]; then