forked from Manisso/fsociety
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·95 lines (87 loc) · 4.24 KB
/
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
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
clear
echo "
███████╗███████╗ ██████╗ ██████╗██╗███████╗████████╗██╗ ██╗
██╔════╝██╔════╝██╔═══██╗██╔════╝██║██╔════╝╚══██╔══╝╚██╗ ██╔╝
█████╗ ███████╗██║ ██║██║ ██║█████╗ ██║ ╚████╔╝
██╔══╝ ╚════██║██║ ██║██║ ██║██╔══╝ ██║ ╚██╔╝
██║ ███████║╚██████╔╝╚██████╗██║███████╗ ██║ ██║
╚═╝ ╚══════╝ ╚═════╝ ╚═════╝╚═╝╚══════╝ ╚═╝ ╚═╝
██╗███╗ ██╗███████╗████████╗ █████╗ ██╗ ██╗ ███████╗██████╗
██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗██║ ██║ ██╔════╝██╔══██╗
██║██╔██╗ ██║███████╗ ██║ ███████║██║ ██║ █████╗ ██████╔╝
██║██║╚██╗██║╚════██║ ██║ ██╔══██║██║ ██║ ██╔══╝ ██╔══██╗
██║██║ ╚████║███████║ ██║ ██║ ██║███████╗███████╗███████╗██║ ██║
╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═╝
";
if [ "$PREFIX" = "/data/data/com.termux/files/usr" ]; then
INSTALL_DIR="$PREFIX/usr/share/doc/fsociety"
BIN_DIR="$PREFIX/bin/"
BASH_PATH="$PREFIX/bin/bash"
TERMUX=true
pkg install -y git python2
elif [ "$(uname)" = "Darwin" ]; then
INSTALL_DIR="/usr/local/fsociety"
BIN_DIR="/usr/local/bin/"
BASH_PATH="/bin/bash"
TERMUX=false
else
INSTALL_DIR="$HOME/.fsociety"
BIN_DIR="/usr/local/bin/"
BASH_PATH="/bin/bash"
TERMUX=false
sudo apt-get install -y git python2.7
fi
echo "[✔] Checking directories...";
if [ -d "$INSTALL_DIR" ]; then
echo "[◉] A directory fsociety was found! Do you want to replace it? [Y/n]:" ;
read mama
if [ "$mama" = "y" ]; then
if [ "$TERMUX" = true ]; then
rm -rf "$INSTALL_DIR"
rm "$BIN_DIR/fsociety*"
else
sudo rm -rf "$INSTALL_DIR"
sudo rm "$BIN_DIR/fsociety*"
fi
else
echo "[✘] If you want to install you must remove previous installations [✘] ";
echo "[✘] Installation failed! [✘] ";
exit
fi
fi
echo "[✔] Cleaning up old directories...";
if [ -d "$ETC_DIR/Manisso" ]; then
echo "$DIR_FOUND_TEXT"
if [ "$TERMUX" = true ]; then
rm -rf "$ETC_DIR/Manisso"
else
sudo rm -rf "$ETC_DIR/Manisso"
fi
fi
echo "[✔] Installing ...";
echo "";
git clone --depth=1 https://github.com/Manisso/fsociety "$INSTALL_DIR";
echo "#!$BASH_PATH
python $INSTALL_DIR/fsociety.py" '${1+"$@"}' > "$INSTALL_DIR/fsociety";
chmod +x "$INSTALL_DIR/fsociety";
if [ "$TERMUX" = true ]; then
cp "$INSTALL_DIR/fsociety" "$BIN_DIR"
cp "$INSTALL_DIR/fsociety.cfg" "$BIN_DIR"
else
sudo cp "$INSTALL_DIR/fsociety" "$BIN_DIR"
sudo cp "$INSTALL_DIR/fsociety.cfg" "$BIN_DIR"
fi
rm "$INSTALL_DIR/fsociety";
if [ -d "$INSTALL_DIR" ] ;
then
echo "";
echo "[✔] Tool installed successfully! [✔]";
echo "";
echo "[✔]====================================================================[✔]";
echo "[✔] All is done!! You can execute tool by typing fsociety ! [✔]";
echo "[✔]====================================================================[✔]";
echo "";
else
echo "[✘] Installation failed! [✘] ";
exit
fi