generated from hidessh99/tuunnel-mx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmenu.sh
232 lines (223 loc) · 8.02 KB
/
menu.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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#!/bin/bash
dateFromServer=$(curl -v --insecure --silent https://google.com/ 2>&1 | grep Date | sed -e 's/< Date: //')
biji=`date +"%Y-%m-%d" -d "$dateFromServer"`
#########################
BURIQ () {
curl -sS https://raw.githubusercontent.com/kmardhex/swip/main/main/allow > /root/tmp
data=( `cat /root/tmp | grep -E "^### " | awk '{print $2}'` )
for user in "${data[@]}"
do
exp=( `grep -E "^### $user" "/root/tmp" | awk '{print $3}'` )
d1=(`date -d "$exp" +%s`)
d2=(`date -d "$biji" +%s`)
exp2=$(( (d1 - d2) / 86400 ))
if [[ "$exp2" -le "0" ]]; then
echo $user > /etc/.$user.ini
else
rm -f /etc/.$user.ini > /dev/null 2>&1
fi
done
rm -f /root/tmp
}
MYIP=$(curl -sS ipv4.icanhazip.com)
Name=$(curl -sS https://raw.githubusercontent.com/kmardhex/swip/main/main/allow | grep $MYIP | awk '{print $2}')
echo $Name > /usr/local/etc/.$Name.ini
CekOne=$(cat /usr/local/etc/.$Name.ini)
Bloman () {
if [ -f "/etc/.$Name.ini" ]; then
CekTwo=$(cat /etc/.$Name.ini)
if [ "$CekOne" = "$CekTwo" ]; then
res="Expired"
fi
else
res="Permission Accepted..."
fi
}
PERMISSION () {
MYIP=$(curl -sS ipv4.icanhazip.com)
IZIN=$(curl -sS https://raw.githubusercontent.com/kmardhex/swip/main/main/allow | awk '{print $4}' | grep $MYIP)
if [ "$MYIP" = "$IZIN" ]; then
Bloman
else
res="Permission Denied!"
fi
BURIQ
}
x="ok"
cekray=`cat /root/log-install.txt | grep -ow "XRAY" | sort | uniq`
if [ "$cekray" = "XRAY" ]; then
rekk='XRAY'
bec='xray'
else
rekk='V2RAY'
bec='v2ray'
fi
PERMISSION
if [ "$res" = "Expired" ]; then
Exp="\e[36mExpired\033[0m"
rm -f /home/needupdate > /dev/null 2>&1
else
Exp=$(curl -sS https://raw.githubusercontent.com/kmardhex/swip/main/main/allow | grep $MYIP | awk '{print $3}')
fi
clear
echo -e "\e[36m╒════════════════════════════════════════════╕\033[0m"
echo -e " \E[0;41;36m INFO SERVER \E[0m"
echo -e "\e[36m╘════════════════════════════════════════════╛\033[0m"
uphours=`uptime -p | awk '{print $2,$3}' | cut -d , -f1`
upminutes=`uptime -p | awk '{print $4,$5}' | cut -d , -f1`
uptimecek=`uptime -p | awk '{print $6,$7}' | cut -d , -f1`
cekup=`uptime -p | grep -ow "day"`
IPVPS=$(curl -s ipinfo.io/ip )
serverV=$( curl -sS https://raw.githubusercontent.com/bokir-tampan/test/main/versi)
if [ "$cekup" = "day" ]; then
echo -e "System Uptime : $uphours $upminutes $uptimecek"
else
echo -e "System Uptime : $uphours $upminutes"
fi
echo -e "Use Core : $rekk"
echo -e "Current Domain : $(cat /etc/$bec/domain)"
echo -e "IP-VPS : $IPVPS"
echo -e "\e[36m╒════════════════════════════════════════════╕\033[0m"
echo -e " \E[0;41;36m SSH MENU \E[0m"
echo -e "\e[36m╘════════════════════════════════════════════╛\033[0m"
echo -e " [\033[1;36m01\033[0m] Add User SSH
[\033[1;36m02\033[0m] SSH WS Enable
[\033[1;36m03\033[0m] Cek User SSH
[\033[1;36m04\033[0m] Del User SSH
[\033[1;36m05\033[0m] Renew SSH
[\033[1;36m06\033[0m] Member
\e[36m╒════════════════════════════════════════════╕\033[0m"
echo -e " \E[0;41;36m XRAY MENU \E[0m"
echo -e "\e[36m╘════════════════════════════════════════════╛\033[0m
[\033[1;36m07\033[0m] Add Vmess Account
[\033[1;36m08\033[0m] Add Vless Account
[\033[1;36m09\033[0m] Addd Trojan Account
[\033[1;36m10\033[0m] Add Sodosok Account
[\033[1;36m11\033[0m] Cek User Xray
[\033[1;36m12\033[0m] Del User Xray
[\033[1;36m13\033[0m] Renew User Xray"
echo -e "\e[36m╒════════════════════════════════════════════╕\033[0m"
echo -e " \E[0;41;36m Settings MENU \E[0m"
echo -e "\e[36m╘════════════════════════════════════════════╛\033[0m
[\033[1;36m14\033[0m] Add-host
[\033[1;36m15\033[0m] Gen SSL
[\033[1;36m16\033[0m] Backup
[\033[1;36m17\033[0m] Restore
[\033[1;36m18\033[0m] Xol Panel Bot
"
if [[ $(cat /opt/.ver) = $serverV ]] > /dev/null 2>&1; then
echo -ne
else
echo -e "[\033[1;32m999\033[0m] • \033[0;31mUpdate Available ! Go choice 69 to update\033[0m"
echo ""
fi
echo -e "\033[1;37mPress [ Ctrl+C ] • To-Exit-Script\033[0m"
echo ""
#echo -e "\e[36m╘════════════════════════════════════════════════════╛\033[0m"
echo -e "\e[36m╒═════════════════════════════════════════════╕\033[0m"
if [[ $(cat /opt/.ver) = $serverV ]] > /dev/null 2>&1; then
echo -e "Version :\033[1;36m $(cat /opt/.ver) Latest Version\e[0m"
echo -e "Client Name : $Name"
echo -e "Expiry script : $Exp"
rm -f /home/needupdate > /dev/null 2>&1
else
rm /dev/.permiss > /dev/null 2>&1
touch /home/needupdate > /dev/null 2>&1
echo -e "\033[0;33mVersion : $(cat /opt/.ver) Update available to $serverV\e[0m"
echo -e "\e[36m╒═════════════════════════════════════════════╕\033[0m"
echo ""
echo -e "[ \033[0;31mChangelog\033[0m ]"
curl -sS https://raw.githubusercontent.com/bokir-tampan/biji/main/clgshow
echo -e "
"
fi
echo -e "\e[36m╘═════════════════════════════════════════════╛\033[0m"
echo
echo -ne "Select menu : "; read x
if [[ $(cat /opt/.ver) = $serverV ]] > /dev/null 2>&1; then
if [[ $x -eq 1 ]]; then
usernew
elif [[ $x -eq 2 ]]; then
sshws
elif [[ $x -eq 3 ]]; then
cek
elif [[ $x -eq 4 ]]; then
hapus
elif [[ $x -eq 5 ]]; then
renew
elif [[ $x -eq 6 ]]; then
member
elif [[ $x -eq 7 ]]; then
add-ws
elif [[ $x -eq 8 ]]; then
add-vless
elif [[ $x -eq 9 ]]; then
add-tr
elif [[ $x -eq 10 ]]; then
add-ssws
elif [[ $x -eq 11 ]]; then
cek-user
elif [[ $x -eq 12 ]]; then
del-user
elif [[ $x -eq 13 ]]; then
renew-xray
elif [[ $x -eq 14 ]]; then
add-host
elif [[ $x -eq 15 ]]; then
crtv2ray
elif [[ $x -eq 16 ]]; then
bckp
elif [[ $x -eq 17 ]]; then
restore
elif [[ $x -eq 18 ]]; then
xolpanel
else
menu
fi
else
if [[ $x -eq 69 ]]; then
wget -q -O /usr/bin/update-script "https://raw.githubusercontent.com/kmardhex/swip/main/dll/system/update-script.sh" && chmod +x /usr/bin/update-script
screen -S upds update-script
menu
elif [[ $x -eq 1 ]]; then
usernew
elif [[ $x -eq 2 ]]; then
sshws
elif [[ $x -eq 3 ]]; then
cek
elif [[ $x -eq 4 ]]; then
hapus
elif [[ $x -eq 5 ]]; then
renew
elif [[ $x -eq 6 ]]; then
member
elif [[ $x -eq 7 ]]; then
add-ws
elif [[ $x -eq 8 ]]; then
add-vless
elif [[ $x -eq 9 ]]; then
add-tr
elif [[ $x -eq 10 ]]; then
add-ssws
elif [[ $x -eq 11 ]]; then
cek-user
elif [[ $x -eq 12 ]]; then
del-user
elif [[ $x -eq 13 ]]; then
renew-xray
elif [[ $x -eq 13 ]]; then
renew-xray
elif [[ $x -eq 14 ]]; then
add-host
elif [[ $x -eq 15 ]]; then
crtv2ray
elif [[ $x -eq 16 ]]; then
bckp
elif [[ $x -eq 17 ]]; then
restore
elif [[ $x -eq 18 ]]; then
xolpanel
else
menu
fi
fi