forked from NevermoreSSH/Blueblue
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrunning.sh
363 lines (329 loc) · 14.1 KB
/
running.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
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
BIBlack='\033[1;90m' # Black
BIRed='\033[1;91m' # Red
BIGreen='\033[1;92m' # Green
BIYellow='\033[1;93m' # Yellow
BIBlue='\033[1;94m' # Blue
BIPurple='\033[1;95m' # Purple
BICyan='\033[1;96m' # Cyan
BIWhite='\033[1;97m' # White
UWhite='\033[4;37m' # White
On_IPurple='\033[0;105m' #
On_IRed='\033[0;101m'
IBlack='\033[0;90m' # Black
IRed='\033[0;91m' # Red
IGreen='\033[0;92m' # Green
IYellow='\033[0;93m' # Yellow
IBlue='\033[0;94m' # Blue
IPurple='\033[0;95m' # Purple
ICyan='\033[0;96m' # Cyan
IWhite='\033[0;97m' # White
NC='\e[0m'
# // Export Color & Information
export RED='\033[0;31m'
export GREEN='\033[0;32m'
export YELLOW='\033[0;33m'
export BLUE='\033[0;34m'
export PURPLE='\033[0;35m'
export CYAN='\033[0;36m'
export LIGHT='\033[0;37m'
export NC='\033[0m'
# // Export Banner Status Information
export EROR="[${RED} EROR ${NC}]"
export INFO="[${YELLOW} INFO ${NC}]"
export OKEY="[${GREEN} OKEY ${NC}]"
export PENDING="[${YELLOW} PENDING ${NC}]"
export SEND="[${YELLOW} SEND ${NC}]"
export RECEIVE="[${YELLOW} RECEIVE ${NC}]"
# // Export Align
export BOLD="\e[1m"
export WARNING="${RED}\e[5m"
export UNDERLINE="\e[4m"
# // Exporting URL Host
export Server_URL="raw.githubusercontent.com/NevermoreSSH/Blueblue/main/test"
export Server1_URL="raw.githubusercontent.com/NevermoreSSH/Blueblue/main/limit"
export Server_Port="443"
export Server_IP="underfined"
export Script_Mode="Stable"
export Auther=".geovpn"
# // Root Checking
if [ "${EUID}" -ne 0 ]; then
echo -e "${EROR} Please Run This Script As Root User !"
exit 1
fi
# // Exporting IP Address
export IP=$( curl -s https://ipinfo.io/ip/ )
# // Exporting Network Interface
export NETWORK_IFACE="$(ip route show to default | awk '{print $5}')"
GREEN='\033[0;32m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
NC='\033[0m'
yl='\e[32;1m'
bl='\e[36;1m'
gl='\e[32;1m'
rd='\e[31;1m'
mg='\e[0;95m'
blu='\e[34m'
op='\e[35m'
or='\033[1;33m'
bd='\e[1m'
color1='\e[031;1m'
color2='\e[34;1m'
color3='\e[0m'
# Getting
# IP Validation
dateFromServer=$(curl -v --insecure --silent https://google.com/ 2>&1 | grep Date | sed -e 's/< Date: //')
biji=`date +"%Y-%m-%d" -d "$dateFromServer"`
#########################
MYIP=$(curl -sS ipinfo.io/ip)
red='\e[1;31m'
green='\e[1;32m'
NC='\e[0m'
green() { echo -e "\\033[32;1m${*}\\033[0m"; }
red() { echo -e "\\033[31;1m${*}\\033[0m"; }
PERMISSION
clear
# 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
#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 [email protected] --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 $0}' | cut -d "(" -f2 | cut -d ")" -f1)
#ssh_status=$(systemctl status shadowsocks-libev-server@http | grep Active | awk '{print $0}' | cut -d "(" -f2 | cut -d ")" -f1)
#status_ss_http="$(systemctl show [email protected] --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)
#trojangfw_server=$(systemctl status trojan | 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 [email protected] --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-stunnel.service | grep Active | awk '{print $3}' | cut -d "(" -f2 | cut -d ")" -f1)
#wsdrop=$(systemctl status ws-dropbear.service | 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 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
# 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 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 TROJAN GFW
if [[ $trojangfw_server == "running" ]]; then
status_virus_trojangfw=" ${GREEN}Running ${NC}( No Error )${NC}"
else
status_virus_trojangfw="${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 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
# 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)
#Name=$(curl -sS https://raw.githubusercontent.com/Fahmiiiiiiii/anjim/main/anjay/allow | grep $MYIP | awk '{print $2}')
#Exp=$(curl -sS https://raw.githubusercontent.com/Fahmiiiiiiii/anjim/main/anjay/allow | grep $MYIP | awk '{print $3}')
# GETTING DOMAIN NAME
Domen="$(cat /etc/xray/domain)"
echo -e ""
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo -e "\E[44;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[44;1;39m ⇱ Subscription Information ⇲ \E[0m"
#echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
#echo -e "❇️ Client Name : $Name"
#echo -e "❇️ Exp Script : $Exp"
#echo -e "❇️ Version : Latest Version"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo -e "\E[44;1;39m ⇱ Service Information ⇲ \E[0m"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo -e "❇️ SSH / TUN :$status_ssh"
#echo -e "❇️ OpenVPN :$status_openvpn"
echo -e "❇️ Dropbear :$status_beruangjatuh"
echo -e "❇️ Stunnel5 :$status_stunnel"
#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 "❇️ XRAYS Trojan :$status_virus_trojan"
echo -e "❇️ Trojan GO :$status_virus_trojan"
#echo -e "❇️ Trojan GFW :$status_virus_trojangfw"
echo -e "❇️ Websocket TLS :$swstls"
echo -e "❇️ Websocket None TLS :$swstls"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m${NC}"
echo ""
read -n 1 -s -r -p "Press any key to back on menu"
menu