summaryrefslogtreecommitdiff
path: root/setup.sh
diff options
context:
space:
mode:
authorDan Fedele <dan.fedele@gmail.com>2022-11-07 11:28:13 -0500
committerDan Fedele <dan.fedele@gmail.com>2022-11-07 11:28:13 -0500
commitc059e2bf4d0050f7e08b38944c1065c2fde4d278 (patch)
tree64bb9660a78e5185461777ee3fb76aa20a2046dc /setup.sh
parentaccb338b3ad6487ce1b82dd24ed38a6de5edaa19 (diff)
Bugfixes and more documentation
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 "***********************************"