-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunning.sh
More file actions
425 lines (376 loc) · 15.1 KB
/
Copy pathrunning.sh
File metadata and controls
425 lines (376 loc) · 15.1 KB
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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
#!/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/rendyap100/izinvps/ipuk/ip > /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/rendyap100/izinvps/ipuk/ip | 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/rendyap100/izinvps/ipuk/ip | 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/rendyap100/izinvps/ipuk/ip | grep $MYIP | awk '{print $3}')
fi
clear
MYIP=$(curl -sS ipv4.icanhazip.com)
#########################
# GETTING OS INFORMATION
source /etc/os-release
Versi_OS=$VERSION
ver=$VERSION_ID
Tipe=$NAME
URL_SUPPORT=$HOME_URL
basedong=$ID
# VPS ISP INFORMATION
#ITAM='\033[0;30m'
echo -e "$ITAM"
#REGION=$( curl -s ipinfo.io/region )
#clear
#COUNTRY=$( curl -s ipinfo.io/country )
#clear
#WAKTU=$( curl -s ipinfo.ip/timezone )
#clear
CITY=$( curl -s ipinfo.io/city )
#clear
#REGION=$( curl -s ipinfo.io/region )
#clear
# CHEK STATUS
l2tp_status=$(systemctl status xl2tpd | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
openvpn_service="$(systemctl show openvpn.service --no-page)"
oovpn=$(echo "${openvpn_service}" | grep 'ActiveState=' | cut -f2 -d=)
#status_openvp=$(/etc/init.d/openvpn status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
#status_ss_tls="$(systemctl show shadowsocks-libev-server@tls.service --no-page)"
#ss_tls=$(echo "${status_ss_tls}" | grep 'ActiveState=' | cut -f2 -d=)
sst_status=$(systemctl status shadowsocks-libev-server@tls | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
ssh_status=$(systemctl status shadowsocks-libev-server@http | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
#status_ss_http="$(systemctl show shadowsocks-libev-server@http.service --no-page)"
#ss_http=$(echo "${status_ss_http}" | grep 'ActiveState=' | cut -f2 -d=)
#sssohtt=$(systemctl status shadowsocks-libev-server@*-http | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
#status="$(systemctl show shadowsocks-libev.service --no-page)"
#status_text=$(echo "${status}" | grep 'ActiveState=' | cut -f2 -d=)
tls_v2ray_status=$(systemctl status xray | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
nontls_v2ray_status=$(systemctl status xray | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
vless_tls_v2ray_status=$(systemctl status xray | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
vless_nontls_v2ray_status=$(systemctl status xray | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
ssr_status=$(systemctl status ssrmu | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
trojan_server=$(systemctl status xray | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
dropbear_status=$(/etc/init.d/dropbear status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
stunnel_service=$(/etc/init.d/stunnel5 status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
sstp_service=$(systemctl status accel-ppp | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
squid_service=$(/etc/init.d/squid status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
ssh_service=$(/etc/init.d/ssh status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
vnstat_service=$(/etc/init.d/vnstat status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
cron_service=$(/etc/init.d/cron status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
fail2ban_service=$(/etc/init.d/fail2ban status | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
wg="$(systemctl show wg-quick@wg0.service --no-page)"
swg=$(echo "${wg}" | grep 'ActiveState=' | cut -f2 -d=)
trgo="$(systemctl show trojan-go.service --no-page)"
strgo=$(echo "${trgo}" | grep 'ActiveState=' | cut -f2 -d=)
sswg=$(systemctl status wg-quick@wg0 | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
wstls=$(systemctl status ws-tls | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
wsdrop=$(systemctl status ws-nontls | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
wsovpn=$(systemctl status ws-ovpn | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
#wsopen=$(systemctl status ws-openssh | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
osslh=$(systemctl status sslh | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
ohp=$(systemctl status dropbear-ohp | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
ohq=$(systemctl status openvpn-ohp | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
ohr=$(systemctl status ssh-ohp | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
# COLOR VALIDATION
RED='\033[0;31m'
NC='\033[0m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
LIGHT='\033[0;37m'
clear
# STATUS SERVICE Shadowsocks HTTPS
if [[ $sst_status == "running" ]]; then
status_sst=" ${GREEN}Running ${NC}( No Error )"
else
status_sst="${RED} Not Running ${NC} ( Error )"
fi
# STATUS SERVICE Shadowsocks HTTP
if [[ $ssh_status == "running" ]]; then
status_ssh=" ${GREEN}Running ${NC}( No Error )"
else
status_ssh="${RED} Not Running ${NC} ( Error )"
fi
# STATUS SERVICE OPENVPN
if [[ $oovpn == "active" ]]; then
status_openvpn=" ${GREEN}Running ${NC}( No Error )"
else
status_openvpn="${RED} Not Running ${NC} ( Error )"
fi
# STATUS SERVICE SSH
if [[ $ssh_service == "running" ]]; then
status_ssh=" ${GREEN}Running ${NC}( No Error )"
else
status_ssh="${RED} Not Running ${NC} ( Error )"
fi
# STATUS SERVICE SQUID
if [[ $squid_service == "running" ]]; then
status_squid=" ${GREEN}Running ${NC}( No Error )"
else
status_squid="${RED} Not Running ${NC} ( Error )"
fi
# STATUS SERVICE VNSTAT
if [[ $vnstat_service == "running" ]]; then
status_vnstat=" ${GREEN}Running ${NC}( No Error )"
else
status_vnstat="${RED} Not Running ${NC} ( Error )"
fi
# STATUS SERVICE CRONS
if [[ $cron_service == "running" ]]; then
status_cron=" ${GREEN}Running ${NC}( No Error )"
else
status_cron="${RED} Not Running ${NC} ( Error )"
fi
# STATUS SERVICE FAIL2BAN
if [[ $fail2ban_service == "running" ]]; then
status_fail2ban=" ${GREEN}Running ${NC}( No Error )"
else
status_fail2ban="${RED} Not Running ${NC} ( Error )"
fi
# STATUS SERVICE TLS
if [[ $tls_v2ray_status == "running" ]]; then
status_tls_v2ray=" ${GREEN}Running${NC} ( No Error )"
else
status_tls_v2ray="${RED} Not Running${NC} ( Error )"
fi
# STATUS SERVICE NON TLS V2RAY
if [[ $nontls_v2ray_status == "running" ]]; then
status_nontls_v2ray=" ${GREEN}Running ${NC}( No Error )${NC}"
else
status_nontls_v2ray="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS SERVICE VLESS HTTPS
if [[ $vless_tls_v2ray_status == "running" ]]; then
status_tls_vless=" ${GREEN}Running${NC} ( No Error )"
else
status_tls_vless="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS SERVICE VLESS HTTP
if [[ $vless_nontls_v2ray_status == "running" ]]; then
status_nontls_vless=" ${GREEN}Running${NC} ( No Error )"
else
status_nontls_vless="${RED} Not Running ${NC} ( Error )${NC}"
fi
# SHADOWSOCKSR STATUS
if [[ $ssr_status == "running" ]] ; then
status_ssr=" ${GREEN}Running${NC} ( No Error )${NC}"
else
status_ssr="${RED} Not Running ${NC} ( Error )${NC}"
fi
# SODOSOK
if [[ $status_text == "active" ]] ; then
status_sodosok=" ${GREEN}Running${NC} ( No Error )${NC}"
else
status_sodosok="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS SERVICE TROJAN
if [[ $trojan_server == "running" ]]; then
status_virus_trojan=" ${GREEN}Running ${NC}( No Error )${NC}"
else
status_virus_trojan="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS SERVICE WIREGUARD
if [[ $swg == "active" ]]; then
status_wg=" ${GREEN}Running ${NC}( No Error )${NC}"
else
status_wg="${RED} Not Running ${NC} ( Error )${NC}"
fi
# Status Service Trojan GO
if [[ $strgo == "active" ]]; then
status_trgo=" ${GREEN}Running ${NC}( No Error )${NC}"
else
status_trgo="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS SERVICE L2TP
if [[ $l2tp_status == "running" ]]; then
status_l2tp=" ${GREEN}Running${NC} ( No Error )${NC}"
else
status_l2tp="${RED} Not Running${NC} ( Error )${NC}"
fi
# STATUS SERVICE DROPBEAR
if [[ $dropbear_status == "running" ]]; then
status_beruangjatuh=" ${GREEN}Running${NC} ( No Error )${NC}"
else
status_beruangjatuh="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS SERVICE STUNNEL
if [[ $stunnel_service == "running" ]]; then
status_stunnel=" ${GREEN}Running ${NC}( No Error )"
else
status_stunnel="${RED} Not Running ${NC} ( Error )}"
fi
# STATUS SERVICE SSTP
if [[ $sstp_service == "running" ]]; then
status_sstp=" ${GREEN}Running ${NC}( No Error )"
else
status_sstp="${RED} Not Running ${NC} ( Error )"
fi
# STATUS SERVICE WEBSOCKET TLS
if [[ $wstls == "running" ]]; then
swstls=" ${GREEN}Running ${NC}( No Error )${NC}"
else
swstls="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS SERVICE WEBSOCKET DROPBEAR
if [[ $wsdrop == "running" ]]; then
swsdrop=" ${GREEN}Running ${NC}( No Error )${NC}"
else
swsdrop="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS SERVICE WEBSOCKET OPEN OVPN
if [[ $wsovpn == "running" ]]; then
swsovpn=" ${GREEN}Running ${NC}( No Error )${NC}"
else
swsovpn="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS SERVICE SSLH / SSH
if [[ $osslh == "running" ]]; then
sosslh=" ${GREEN}Running ${NC}( No Error )${NC}"
else
sosslh="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS OHP DROPBEAR
if [[ $ohp == "running" ]]; then
sohp=" ${GREEN}Running ${NC}( No Error )${NC}"
else
sohp="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS OHP OpenVPN
if [[ $ohq == "running" ]]; then
sohq=" ${GREEN}Running ${NC}( No Error )${NC}"
else
sohq="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS OHP SSH
if [[ $ohr == "running" ]]; then
sohr=" ${GREEN}Running ${NC}( No Error )${NC}"
else
sohr="${RED} Not Running ${NC} ( Error )${NC}"
fi
# STATUS SERVICE WEBSOCKET OPENSSH
if [[ $wsopen == "running" ]]; then
swsopen=" ${GREEN}Running ${NC}( No Error )${NC}"
else
swsopen="${RED} Not Running ${NC} ( Error )${NC}"
fi
# TOTAL RAM
total_ram=` grep "MemTotal: " /proc/meminfo | awk '{ print $2}'`
totalram=$(($total_ram/1024))
# TIPE PROCESSOR
#totalcore="$(grep -c "^processor" /proc/cpuinfo)"
#totalcore+=" Core"
#corediilik="$(grep -c "^processor" /proc/cpuinfo)"
#tipeprosesor="$(awk -F ': | @' '/model name|Processor|^cpu model|chip type|^cpu type/ {
# printf $2;
# exit
# }' /proc/cpuinfo)"
# GETTING CPU INFORMATION
#cpu_usage1="$(ps aux | awk 'BEGIN {sum=0} {sum+=$3}; END {print sum}')"
#cpu_usage="$((${cpu_usage1/\.*} / ${corediilik:-1}))"
#cpu_usage+=" %"
# OS UPTIME
#uptime="$(uptime -p | cut -d " " -f 2-10)"
# KERNEL TERBARU
kernelku=$(uname -r)
# WAKTU SEKARANG
#harini=`date -d "0 days" +"%d-%m-%Y"`
#jam=`date -d "0 days" +"%X"`
# DNS PATCH
#tipeos2=$(uname -m)
# GETTING DOMAIN NAME
Domen="$(cat /etc/xray/domain)"
echo -e ""
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo -e "\E[41;1;39m ⇱ Sytem Information ⇲ \E[0m"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo -e " Hostname : $HOSTNAME"
echo -e " OS Name : $Tipe"
#echo -e "Processor : $tipeprosesor"
#echo -e "Proc Core :$totalcore"
#echo -e "Virtual :$typevps"
#echo -e "Cpu Usage :$cpu_usage"
echo -e " Total RAM : ${totalram}MB"
echo -e " Public IP : $MYIP"
echo -e " Domain : $Domen"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo -e "\E[41;1;39m ⇱ Subscription Information ⇲ \E[0m"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo -e " Client Name : $Name"
echo -e " Exp Script : $Exp2"
echo -e " Version : Beta Version"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo -e "\E[41;1;39m ⇱ Service Information ⇲ \E[0m"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo -e " SSH WS & WSS :$status_ssh"
echo -e " OpenVPN :$status_openvpn"
echo -e " Dropbear :$status_beruangjatuh"
echo -e " Squid :$status_squid"
echo -e " Fail2Ban :$status_fail2ban"
echo -e " Crons :$status_cron"
echo -e " Vnstat :$status_vnstat"
echo -e " XRAYS Vmess TLS :$status_tls_v2ray"
echo -e " XRAYS Vmess None TLS :$status_nontls_v2ray"
echo -e " XRAYS Vless TLS :$status_tls_vless"
echo -e " XRAYS Vless None TLS :$status_nontls_vless"
echo -e " Shadowsocks-R :$status_ssh"
echo -e " Shadowsocks-OBFS HTTPS :$status_ssh"
echo -e " Shadowsocks-OBFS HTTP :$status_ssh"
echo -e " XRAYS Trojan :$status_virus_trojan"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo ""
read -n 1 -s -r -p "Klik Enter Untuk Kembali Ke menu"
menu