From d35bf7f3c52f5719558f73b77ed1fc34e6997e89 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Sun, 6 Nov 2022 17:14:38 -0500 Subject: Post CFC version test --- setup.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 setup.sh (limited to 'setup.sh') diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..50a7f46 --- /dev/null +++ b/setup.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# Exit immediately on failure +set -eu + +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as sudo or root." + exit 1 +fi + +PATH_TO_SCRIPT=$(dirname $0) +ZSH_FUNC_FILE="zsh_functions.zsh" +TMUX_FILE="tmux_conf" + +echo "***********************************" +echo "* Installing pip *" +echo "***********************************" + +curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py +python3 /tmp/get-pip.py --user --no-warn-script-location + +export PATH=$PATH:/root/.local/bin + +echo "***********************************" +echo "* Installing ansible *" +echo "***********************************" + +pip install ansible + +echo "***********************************" +echo "* Running Kali playbook *" +echo "***********************************" + +ansible-playbook ${PATH_TO_SCRIPT}/kali.yml --extra-vars "tmux=${PATH_TO_SCRIPT}/${TMUX_FILE} zsh_func=${PATH_TO_SCRIPT}/${ZSH_FUNC_FILE}" + +echo "***********************************" +echo "* Done! *" +echo "***********************************" + +echo "You should be set up. Check above for any errors." -- cgit v1.2.3 From 2a79c8c3499437ede38c81c82c2ca48b91ba3191 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 09:49:21 -0500 Subject: Fixed horrible typo that broke the whole thing --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.sh') diff --git a/setup.sh b/setup.sh index 50a7f46..7bc8a54 100644 --- a/setup.sh +++ b/setup.sh @@ -37,4 +37,4 @@ echo "***********************************" echo "* Done! *" echo "***********************************" -echo "You should be set up. Check above for any errors." +echo "You should reboot your system now." -- cgit v1.2.3 From c059e2bf4d0050f7e08b38944c1065c2fde4d278 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 11:28:13 -0500 Subject: Bugfixes and more documentation --- setup.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'setup.sh') 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 "***********************************" -- cgit v1.2.3 From 27dc9030e0de0c6622ae3f2cde189988d4a8464a Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 7 Nov 2022 11:33:52 -0500 Subject: Bugfixes --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.sh') diff --git a/setup.sh b/setup.sh index 5a42b91..2148bd8 100644 --- a/setup.sh +++ b/setup.sh @@ -5,7 +5,7 @@ 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 +if [ -z ${BASH} ]; then echo "This script must be run from the Bash shell!" exit 1 fi -- cgit v1.2.3