summaryrefslogtreecommitdiff
path: root/setup.sh
diff options
context:
space:
mode:
authorDan Fedele <dan.fedele@gmail.com>2022-11-07 11:36:13 -0500
committerGitHub <noreply@github.com>2022-11-07 11:36:13 -0500
commit4149814addc0747dc4e40590085ec4a626f9ae5a (patch)
tree78cc85e218e6367259aa0a1dd7032e9a68a31e7c /setup.sh
parentc1c81a728173638abf84ad21df34d398fa956240 (diff)
parent27dc9030e0de0c6622ae3f2cde189988d4a8464a (diff)
Merge pull request #2 from AgroDan/dev
Dev
Diffstat (limited to 'setup.sh')
-rw-r--r--setup.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/setup.sh b/setup.sh
new file mode 100644
index 0000000..2148bd8
--- /dev/null
+++ b/setup.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# 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 2
+fi
+
+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 "***********************************"
+
+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 reboot your system now."