-
Notifications
You must be signed in to change notification settings - Fork 33
/
install-minimal.sh
38 lines (32 loc) · 928 Bytes
/
install-minimal.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
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh -eux
if [ "$(id -u)" != "0" ]; then
echo "[-] Detected non-root user."
echo "[-] INSTALLATION FAILED"
exit 1
fi
echo "[+] apt"
apt-get update
apt-get install -y gdb-multiarch wget
GDBINIT_PATH="/root/.gdbinit"
GEF_PATH="$GDBINIT_PATH-gef.py"
echo "[+] download gef"
if [ -e "$GEF_PATH" ]; then
echo "[-] $GEF_PATH already exists. Please delete or rename."
echo "[-] INSTALLATION FAILED"
exit 1
else
wget -q https://raw.githubusercontent.com/bata24/gef/dev/gef.py -O "$GEF_PATH"
if [ ! -s "$GEF_PATH" ]; then
echo "Downloading $GEF_PATH failed."
rm -f "$GEF_PATH"
echo "[-] INSTALLATION FAILED"
exit 1
fi
fi
echo "[+] setup gef"
STARTUP_COMMAND="source $GEF_PATH"
if [ ! -e "$GDBINIT_PATH" ] || [ -z "$(grep "$STARTUP_COMMAND" "$GDBINIT_PATH")" ]; then
echo "$STARTUP_COMMAND" >> "$GDBINIT_PATH"
fi
echo "[+] INSTALLATION SUCCESSFUL"
exit 0