-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathsetup
117 lines (104 loc) · 3.44 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
#!/bin/bash
#########
# 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`
#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
printf "\r ${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"
else
OS=TERMUX
BIN="${PREFIX}/bin"
main="${PREFIX}/share/shark"
pkg update -y > /dev/null 2>&1
pkg install ncurses-utils -y > /dev/null 2>&1
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/bhikandeshmukh/shark --quiet ${main}) & spinner
}
function dependencies() {
launch="installing lib";splashdown="installed lib"; echo
if [ ${OS} != "DEBIAN" ]; then
(pkg install apache2 php jq curl wget git -y > /dev/null 2>&1) & spinner
else
(sudo apt-get install ${i} -y > /dev/null 2>&1) & spinner
fi
}
function setup_ngrok() {
if [ ! -f "${BIN}/ngrok" ]; then
if [[ ("$arch" == *'arm'*) || ("$arch" == *'Android'*) ]]; then
rm -rf $BIN/ngrok
ngrok_url="https://github.com/Bhaviktutorials/Ngrok_magical/raw/main/Magicalrok.zip"
elif [[ "$arch" == *'aarch64'* ]]; then
rm -rf $BIN/ngrok
ngrok_url="https://github.com/Bhaviktutorials/Ngrok_magical/raw/main/Magicalrok.zip"
elif [[ "$arch" == *'x86_64'* ]]; 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-386.zip"
fi
launch="installing ngrok";splashdown="installed ngrok";echo
(wget --quiet ${ngrok_url} -O ngrok.zip) & spinner
unzip -q ngrok.zip && rm -rf ngrok.zip && chmod +x ngrok
mv ngrok $BIN
fi
}
function final_touchup() {
if [ ${OS} != "DEBIAN" ]; then
printf "\n$yellow Enter your Ngrok Authtoken to continue [Ex. ngrok authtoken I7QUQ ] : $nc"
read ngrok_authtoken
$ngrok_authtoken > /dev/null 2&>1
fi
for i in shark; do
chmod +x ${main}/${i}
mv ${main}/${i} ${BIN}
printf "\n${green}>>${white} simply run : shark \n\n ${nc}"
done
}
os
dependencies
git_clone
setup_ngrok
final_touchup
#####################################
# DON'T TRY TO COPY 😂😂 #
# JUST LEARNING KEEP SUPPORTING #
# THANKYOU #
#####################################