forked from Gallopsled/pwntools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·27 lines (21 loc) · 900 Bytes
/
install.sh
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
#!/bin/bash
if [ $UID -ne 0 ] || [ -z "$SUDO_USER" ] ; then
echo "This script must be run with sudo" 1>&2
exit
fi
# at this point we're running through sudo
# commands that should run as the user must be prefixed with $DO
DO="sudo -u \"$SUDO_USER\""
echo "Adding PWNTools to \$PATH in .bashrc"
echo "export PATH=$PWD/bin:\$PATH" >> $(getent passwd $SUDO_USER | cut -d: -f6)/.bashrc
echo "Adding PWNLib to \$PYTHONPATH in .bashrc"
echo "export PYTHONPATH=$PWD/lib:\$PYTHONPATH" >> $(getent passwd $SUDO_USER | cut -d: -f6)/.bashrc
echo "Installing packages"
if [ -f /etc/debian_version ]; then
DEPS="python-crypto python-gmpy python-matplotlib python-sympy python-argparse python-paramiko"
yes | apt-get install ${DEPS}
elif [ -f /etc/arch-release ]; then
DEPS="python2-crypto python2-matplotlib python2-sympy python2-argparse"
yes | pacman -S ${DEPS}
fi
echo "All DONE"