summaryrefslogtreecommitdiff
path: root/setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'setup.sh')
-rw-r--r--setup.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/setup.sh b/setup.sh
index 7bc8a54..5a42b91 100644
--- a/setup.sh
+++ b/setup.sh
@@ -3,15 +3,28 @@
# Exit immediately on failure
set -eu
+# Are we running in bash?
+# Single bracket to be posix compliant in case we run in sh or something
+if [ ! -z ${BASH} ]; then
+ echo "This script must be run from the Bash shell!"
+ exit 1
+fi
+
+# Are we root?
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as sudo or root."
- exit 1
+ exit 2
fi
-PATH_TO_SCRIPT=$(dirname $0)
+PATH_TO_SCRIPT=$(dirname $(readlink -f $0))
ZSH_FUNC_FILE="zsh_functions.zsh"
TMUX_FILE="tmux_conf"
+if [[ ! -e ${PATH_TO_SCRIPT}/${ZSH_FUNC_FILE} ]] && [[ ! -e ${PATH_TO_SCRIPT}/${TMUX_FILE} ]]; then
+ echo "Cannot find supporting files! Please clone repository and try again!"
+ exit 3
+fi
+
echo "***********************************"
echo "* Installing pip *"
echo "***********************************"