-
Notifications
You must be signed in to change notification settings - Fork 105
/
setup
183 lines (174 loc) · 6.63 KB
/
setup
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#!/bin/bash
clear
cd $HOME
#########
# COLORS
#########
#colors
#colors
white="\033[1;37m" ##
grey="\033[0;37m" ##
purple="\033[1;35m" ##
red="\033[1;31m" ##
green="\033[1;32m" ##
yellow="\033[1;33m" ##
purple="\033[0;35m" ##
cyan="\033[0;36m" ##
cyan1="\033[1;36m" ##
cafe="\033[0;33m" ##
fiuscha="\033[0;35m" ##
blue="\033[1;34m" ##
l_red="\033[1;37;41m" ##
nc="\033[0m" ##
arch=`uname -m`
ArNam=$(dpkg --print-architecture)
#spinner
spinner() {
pid=$!
spin='\|/-'
i=0
tput civis
while kill -0 $pid 2>/dev/null
do
i=$(( (i+1) %4 ))
printf "\r${cyan1}[${spin:$i:1}]${nc} ${cyan1} ${launch}"
sleep .1
done
clear
printf "\r\n${green}[✔]${nc} ${green} ${splashdown}";echo
tput cnorm
}
function os () {
cat /etc/os-release > /dev/null 2>&1
if [ "$?" -eq "0" ]; then
OS=DEBIAN
BIN="/usr/bin"
main="/usr/share/shark"
sudo apt install iputils-ping -y &>/dev/null
sudo apt install p7zip-full -y &>/dev/null
else
OS=TERMUX
BIN="${PREFIX}/bin"
main="${PREFIX}/share/shark"
pkg install ncurses-utils -y &>/dev/null
pkg install p7zip -y &>/dev/null
fi
}
function git_clone() {
launch="cloning shark";splashdown="shark cloned";echo
[ -d "${main}" ] && rm -rf ${main} > /dev/null 2>&1
(git clone https://github.com/E343IO/shark --quiet ${main} --depth=1) & spinner
}
function dependencies() {
killall -q dpkg apt pkg &>/dev/null
clear
sleep 1
launch="installing lib";splashdown="installed lib"; echo
for i in apache2 php jq curl git unzip dialog proot sox ffmpeg; do
if [ ${OS} != "DEBIAN" ]; then
(pkg update -y &> /dev/null && pkg install ${i} -y &> /dev/null && pkg install proot resolv-conf &> /dev/null)& spinner
else
(sudo apt-get install ${i} -y &> /dev/null && sudo dnf -y install &> /dev/null)& spinner
fi
done
}
function setup_cloudflare() {
if [ ! -f ${BIN}/cloudflared ]; then
if [[ ("$arch" == *'arm'*) || ("$arch" == *'Android'*) ]]; then
cloudd="https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm"
elif [[ "$arch" == *'aarch64'* ]]; then
cloudd="https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64"
elif [[ "$arch" == *'x86_64'* ]]; then
if [[ "$ArNam" == *'amd64'* ]]; then
cloudd="https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64"
else
cloudd="https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64"
fi
else
cloudd="https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-386"
fi
launch="Installing server-1, size@25mb";splashdown="installed.";echo
(wget --quiet ${cloudd} -O cloudflared)& spinner
chmod +x cloudflared && mv cloudflared $BIN
else
echo ""
fi
}
function setup_ngrok() {
if [ ! -f "${BIN}/ngrok" ]; then
if [[ ("$arch" == *'arm'*) || ("$arch" == *'Android'*) ]]; then
ngrok_url="https://github.com/E343IO/stuff/raw/main/ngrok-2in1.zip"
elif [[ "$arch" == *'aarch64'* ]]; then
if [[ "$ArNam" == *'amd64'* ]]; then
ngrok_url="https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip"
else
ngrok_url="https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.zip"
fi
elif [[ "$arch" == *'x86_64'* ]]; then
if [[ "$ArNam" == *'amd64'* ]]; then
ngrok_url="https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip"
else
ngrok_url="https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm64.zip"
fi
else
ngrok_url="https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-386.zip"
fi
launch="installing server-2, size@4mb";splashdown="Installed.";echo
(wget --quiet $ngrok_url -O ngrok.zip)& spinner
unzip -q ngrok.zip && rm -rf ngrok.zip && chmod +x ngrok && mv ngrok $BIN
else
echo ""
fi
}
function final_touchup() {
for i in shark; do
chmod +x ${main}/${i}
mv ${main}/${i} ${BIN}
launch="setting up files"; splashdown="done";echo
(cd ${main} && 7z x file &>/dev/null)& spinner
done
if [ ${OS} != "DEBIAN" ]; then
clear
dialog --title "© SHARK 2022-2023" --inputbox "*Ngrok Authtoken verification \nEnter your authtoken without './' :" 0 0 2> authtk
mv authtk ${BIN}
chmod +x ${BIN}/authtk
sleep 2
clear
sleep 2
authtk &>/dev/null
export user=$HOME
mv ${BIN}/authtk ${BIN}/authtoken
chmod +x ${BIN}/authtoken
#printf ${yellow}"Full exiting....\nJust Reopen your termux after exit. \n"
sleep 1
printf "\n${green}>>${white} simply run : shark \n\n ${nc}"
else
clear
dialog --title "© SHARK 2022-2023" --inputbox "*Ngrok Authtoken verification \nEnter your authtoken without './' :" 0 0 2> authtk
mv authtk ${BIN}
chmod +x ${BIN}/authtk
sleep 2
clear
authtk &>/dev/null
printf "\n${green}>>${white} simply run : shark \n\n ${nc}"
fi
}
printf "${yellow}Please Wait.\n\n[!] Don't terminate this task.\n"
os
clear
printf "${green}Setting up libs...\n"
sleep 2
clear
dependencies
git_clone
setup_cloudflare
setup_ngrok
final_touchup
#########################################
# DON'T TRY TO COPY 😂😂 #
# JUST LEARNING KEEP SUPPORTING #
# THANKYOU #
# M r. D e r e K (Contributor) #
# B h a v i k O z a (Publisher) #
# A s h i s h S i n g h (Author) #
#########################################