-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
52 lines (44 loc) · 1.21 KB
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
function color_header {
echo -e "\e[35m$1\e[0m"
}
#-- Init
if [ `whoami` = root ]; then
echo "Please do not run this script as root. You will be prompted for a sudo password."
exit
fi
sudo -k # Revoke any sudo privs currently available
echo -n "Please enter the sudo password for $( whoami ):"
read -s password
echo
if ( echo -n "$password" | sudo -S -v 2>/dev/null ); then
echo "Password ok"
else
echo -e "Password incorrect, aborting script.\n\n"
exit 1
fi
#-- Install Dependencies
color_header "Installing apt dependencies..."
echo -n "$password" | sudo -S apt install -y python3 python3-pip python3-dev build-essential libssl-dev libffi-dev
color_header "Done!"
#-- Create Environment
color_header "Creating virtual environment..."
python3 -m venv venv
#-- Create bash shim for python script
cat << EOF > NotHydra
#!/bin/bash
#$( pwd )/venv/bin/python $( pwd )/NotHydra.py "\$@"
. venv/bin/activate
venv/bin/python NotHydra.py "\$@"
deactivate
EOF
chmod +x NotHydra
color_header "Done!"
color_header "Installing pip dependencies..."
. venv/bin/activate
pip install --default-timeout=100 -r requirements.txt
deactivate
color_header "Done!"
color_header "Installation complete! :)"
echo
echo