-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
install.sh
executable file
·114 lines (89 loc) · 2.54 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/usr/bin/env bash
LOG_DIR=$PWD/logs
DB_DIR=$PWD/db
ILOG=$LOG_DIR/install.log
mkdir -p $LOG_DIR $DB_DIR
status_check() {
if [ $? -eq 0 ]
then
echo -e "$1 - Installed"
else
echo -e "$1 - Failed!"
fi
}
debian_install() {
echo -e '=====================\nINSTALLING FOR DEBIAN\n=====================\n' > "$ILOG"
pkgs="python3 python3-pip python3-requests python3-packaging python3-psutil php"
install_cmd() {
echo -ne '$1\r'
sudo apt -y install $1 &>> "$ILOG"
status_check $1
echo -e '\n--------------------\n' >> "$ILOG"
}
for pkg_name in $pkgs; do
install_cmd $pkg_name
done
}
fedora_install() {
echo -e '=====================\nINSTALLING FOR FEDORA\n=====================\n' > "$ILOG"
pkgs="python3 python3-pip python3-requests python3-packaging python3-psutil php"
install_cmd() {
echo -ne "$1\r"
sudo dnf install $1 -y &>> "$ILOG"
status_check $1
echo -e '\n--------------------\n' >> "$ILOG"
}
for pkg_name in $pkgs; do
install_cmd $pkg_name
done
}
termux_install() {
echo -e '=====================\nINSTALLING FOR TERMUX\n=====================\n' > "$ILOG"
pkgs="python php"
pip_pkgs="requests packaging psutil"
install_cmd() {
echo -ne "$1\r"
apt -y install $1 &>> "$ILOG"
status_check $1
echo -e '\n--------------------\n' >> "$ILOG"
}
install_pip() {
echo -ne "$1\r"
pip install -U $1 &>> "$ILOG"
status_check $1
echo -e '\n--------------------\n' >> "$ILOG"
}
for pkg_name in $pkgs; do
install_cmd $pkg_name
done
for pkg_name in $pip_pkgs; do
install_pip $pkg_name
done
}
arch_install() {
echo -e '=========================\nINSTALLING FOR ARCH LINUX\n=========================\n' > "$ILOG"
install_cmd() {
echo -ne "$1\r"
yes | sudo pacman -S $1 --needed &>> "$ILOG"
status_check $1
echo -e '\n--------------------\n' >> "$ILOG"
}
pkgs="python3 python-pip python-requests python-packaging python-psutil php"
for pkg_name in $pkgs; do
install_cmd $pkg_name
done
}
echo -e '[!] Installing Dependencies...\n'
if [ -f '/etc/arch-release' ]; then
arch_install
elif [ -f '/etc/fedora-release' ]; then
fedora_install
else
if [ -z "${TERMUX_VERSION}" ]; then
debian_install
else
termux_install
fi
fi
echo -e '=========\nCOMPLETED\n=========\n' >> "$ILOG"
echo -e '\n[+] Log Saved :' "$ILOG"