-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextraMenu.sh
999 lines (896 loc) · 27.3 KB
/
extraMenu.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
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
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
#!/bin/bash
#EXTREME DOT Multibalance Menu
scriptVersion=0.21
echo "nameserver 8.8.8.8" > /etc/resolv.conf
# root checker
function isRoot() {
if [ "$EUID" -ne 0 ]; then
return 1
fi
}
# IS root access?
if ! isRoot; then
echo "Sorry, you need to run this as root"
exit 1
fi
apt --fix-broken install
# Load Colors
function colorScript() {
mkdir -p /Golden1/
touch /Golden1/defaults.sh
cat <<EOF > /Golden1/defaults.sh
RED='\033[0;31m' # Red
BLUE='\033[1;34m' # LIGHTBLUE
GREEN='\033[0;32m' # Green
NC='\033[0m' # No Color
HOST_PING=8.8.8.8
PINGTXT1=\`echo "-- PING Check: -----------------------------------------------" | cut -c 1-45\`
INTFTXT1=\`echo "-- INTERFACE Check: -----------------------------------------------" | cut -c 1-45\`
EOF
# COLOR SCRIPTING
YELLOW='\033[0;33m' # YELLOW
RED='\033[0;31m' # Red
BLUE='\033[1;34m' # LIGHTBLUE
GREEN='\033[0;32m' # Green
NC='\033[0m' # No Color
red(){
echo -e "\033[31m\033[01m$1\033[0m"
}
green(){
echo -e "\033[32m\033[01m$1\033[0m"
}
yellow(){
echo -e "\033[33m\033[01m$1\033[0m"
}
blue(){
echo -e "\033[34m\033[01m$1\033[0m"
}
bold(){
echo -e "\033[1m\033[01m$1\033[0m"
}
Green_font_prefix="\033[32m"
Red_font_prefix="\033[31m"
Green_background_prefix="\033[42;37m"
Red_background_prefix="\033[41;37m"
Font_color_suffix="\033[0m"
}
# Installing Tools
function installTools() {
echo "nameserver 8.8.8.8" > /etc/resolv.conf
# get apt updates
apt-get updates
echo "nameserver 8.8.8.8" > /etc/resolv.conf
# installing lsof
if [ $(dpkg-query -W -f='${Status}' lsof 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
yellow "Installing lsof"
apt install -y lsof
else
green "lsof has installed"
fi
echo "nameserver 8.8.8.8" > /etc/resolv.conf
# installing iptables-persistent
if [ $(dpkg-query -W -f='${Status}' iptables-persistent 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
yellow "Installing iptables-persistent"
apt install -y iptables-persistent
else
green "iptables-persistent has installed"
fi
echo "nameserver 8.8.8.8" > /etc/resolv.conf
if [ $(dpkg-query -W -f='${Status}' crontab 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
yellow "Installing cron services"
apt-get install cron
else
green "cron service has allready installed"
fi
echo "nameserver 8.8.8.8" > /etc/resolv.conf
# installing unzip
if [ $(dpkg-query -W -f='${Status}' unzip 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
yellow "Installing unzip"
apt install -y unzip
else
green "unzip has installed"
fi
echo "nameserver 8.8.8.8" > /etc/resolv.conf
# installing socat
if [ $(dpkg-query -W -f='${Status}' socat 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
yellow "Installing socat"
apt install -y socat
else
green "socat has installed"
fi
echo "nameserver 8.8.8.8" > /etc/resolv.conf
# installing curl
if [ $(dpkg-query -W -f='${Status}' curl 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
yellow "Installing curl"
apt install -y curl
else
green "curl has installed"
fi
echo "nameserver 8.8.8.8" > /etc/resolv.conf
# installing dnsutils
if [ $(dpkg-query -W -f='${Status}' dnsutils 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
yellow "Installing dnsutils"
apt install -y dnsutils
else
green "dnsutils has installed"
fi
echo "nameserver 8.8.8.8" > /etc/resolv.conf
if [ $(dpkg-query -W -f='${Status}' net-tools 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
yellow "Installing net tools package"
apt install -y net-tools
else
green "net tools has installed allready"
fi
echo "nameserver 8.8.8.8" > /etc/resolv.conf
if [ $(dpkg-query -W -f='${Status}' ifupdown 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
yellow "Installing ifupdown package"
apt-get install -y ifupdown
else
green "ifupdown has installed allready"
fi
}
### DNS
function setDNSpermanent() {
clear
echo " CURRNET DNS LIST"
if grep -q "127.0.0.53" "/etc/resolv.conf"; then
RESOLVCONF='/run/systemd/resolve/resolv.conf'
else
RESOLVCONF='/etc/resolv.conf'
fi
echo "$RESOLVCONF "
echo "`sed -ne 's/^nameserver[[:space:]]\+\([^[:space:]]\+\).*$/\1/p' $RESOLVCONF`"
echo
echo "What DNS resolvers do you want to use with the VPN?"
echo " 1) Cloudflare (Anycast: worldwide)"
echo " 2) Quad9 (Anycast: worldwide)"
echo " 3) Quad9 uncensored (Anycast: worldwide)"
echo " 4) FDN (France)"
echo " 5) DNS.WATCH (Germany)"
echo " 6) OpenDNS (Anycast: worldwide)"
echo " 7) Google (Anycast: worldwide)"
echo " 8) Yandex Basic (Russia)"
echo " 9) AdGuard DNS (Anycast: worldwide)"
echo " 10) NextDNS (Anycast: worldwide)"
echo " 11) SKIP, No change"
echo " 12) Custom"
until [[ $DNS =~ ^[0-9]+$ ]] && [ "$DNS" -ge 1 ] && [ "$DNS" -le 12 ]; do
read -rp "DNS [1-12]: " -e -i 9 DNS
if [[ $DNS == "12" ]]; then
until [[ $DNS1 =~ ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ ]]; do
read -rp "Primary DNS: " -e DNS1
done
until [[ $DNS2 =~ ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ ]]; do
read -rp "Secondary DNS (optional): " -e DNS2
if [[ $DNS2 == "" ]]; then
break
fi
done
fi
done
apt install -y resolvconf
sudo systemctl start resolvconf.service
sudo systemctl enable resolvconf.service
DEST_RESOLV="/etc/resolvconf/resolv.conf.d/head"
case $DNS in
1) # Cloudflare
echo 'nameserver 1.1.1.1' > $DEST_RESOLV
echo 'nameserver 1.0.0.1' >> $DEST_RESOLV
DNSMSQ_SERV=1.1.1.1
DNSMSQ_SERV2=1.0.0.1
;;
2) # Quad9
echo 'nameserver 9.9.9.9' > $DEST_RESOLV
echo 'nameserver 149.112.112.112' >> $DEST_RESOLV
DNSMSQ_SERV=9.9.9.9
DNSMSQ_SERV2=149.112.112.112
;;
3) # Quad9 uncensored
echo 'nameserver 9.9.9.10' > $DEST_RESOLV
echo 'nameserver 149.112.112.10' >> $DEST_RESOLV
DNSMSQ_SERV=9.9.9.10
DNSMSQ_SERV2=149.112.112.10
;;
4) # FDN
echo 'nameserver 80.67.169.40' > $DEST_RESOLV
echo 'nameserver 80.67.169.12' >> $DEST_RESOLV
DNSMSQ_SERV=80.67.169.40
DNSMSQ_SERV2=80.67.169.12
;;
5) # DNS.WATCH
echo 'nameserver 84.200.69.80' > $DEST_RESOLV
echo 'nameserver 84.200.70.40' >> $DEST_RESOLV
DNSMSQ_SERV=84.200.69.80
DNSMSQ_SERV2=84.200.70.40
;;
6) # OpenDNS
echo 'nameserver 208.67.222.222' > $DEST_RESOLV
echo 'nameserver 208.67.220.220' >> $DEST_RESOLV
DNSMSQ_SERV=208.67.222.222
DNSMSQ_SERV2=208.67.220.220
;;
7) # Google
echo 'nameserver 8.8.8.8' > $DEST_RESOLV
echo 'nameserver 8.8.4.4' >> $DEST_RESOLV
DNSMSQ_SERV=8.8.8.8
DNSMSQ_SERV2=8.8.4.4
;;
8) # Yandex Basic
echo 'nameserver 77.88.8.8' > $DEST_RESOLV
echo 'nameserver 77.88.8.1' >> $DEST_RESOLV
DNSMSQ_SERV=77.88.8.8
DNSMSQ_SERV2=77.88.8.1
;;
9) # AdGuard DNS
echo 'nameserver 94.140.14.14' > $DEST_RESOLV
echo 'nameserver 94.140.15.15' >> $DEST_RESOLV
DNSMSQ_SERV=94.140.14.14
DNSMSQ_SERV2=94.140.15.15
;;
10) # NextDNS
echo 'nameserver 45.90.28.167' > $DEST_RESOLV
echo 'nameserver 45.90.30.167' >> $DEST_RESOLV
DNSMSQ_SERV=45.90.28.167
DNSMSQ_SERV2=45.90.30.167
;;
11) # NO CHNAGE
DNSMSQ_SERV=8.8.8.8
DNSMSQ_SERV2=8.8.4.4
;;
12) # Custom DNS
echo "nameserver $DNS1" > $DEST_RESOLV
DNSMSQ_SERV=$DNS1
DNSMSQ_SERV2=8.8.8.8
if [[ $DNS2 != "" ]]; then
echo "nameserver $DNS2" >> $DEST_RESOLV
DNSMSQ_SERV2=$DNS2
fi
;;
esac
sudo systemctl restart resolvconf.service
sudo systemctl restart systemd-resolved.service
echo " Do reboot to take effects."
echo
echo "you can change the configs from /etc/resolvconf/resolv.conf.d/head file"
echo
}
# LOADING PACKAGES
function firstStart() {
clear
isRoot
colorScript
installTools
}
function updateTheScript() {
mkdir -p /tmp/extdotmenu1
cd /tmp/extdotmenu1
echo "nameserver 8.8.8.8" > /etc/resolv.conf
echo "nameserver 1.1.1.1" >> /etc/resolv.conf
wget https://raw.githubusercontent.com/ExtremeDot/GoldenOne_MENU/main/extraMenu.sh
chmod +x /tmp/extdotmenu1/extraMenu.sh
mv /tmp/extdotmenu1/extraMenu.sh /bin/eMenu
chmod +x /bin/eMenu
bash /bin/eMenu ; exit
}
####################### CLOUDFLARE MENU
function enter2CLmain() {
read -p "Press enter to back to Cloudflare menu"
cloudflaremenu
}
function cloudflaremenu() {
clear
CLFscriptVersion=1.00
# CLF STATUS
if [ $(dpkg-query -W -f='${Status}' cloudflare-warp 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
red "cloudflare-warp not found, please install it first"
CLSTATUS=FALSE
else
CLSTATUS=TRUE
green "cloudflare-warp has installed"
fi
## MENU
echo -e "${GREEN}"
clear
blue "EXTREME DOT - Cloudflare MENU =================================================[Version $CLFscriptVersion]"
echo
echo "1) Cloudflare Warp+ Client Details 2) Install Cloudflare Warp+"
echo "3) Register and Enable New Account 4) Set New Licence Key"
echo "5) Connect 6) Disconnect"
echo "7) Connection Full Stat 8) Check IP Location of CloudFlare Client"
red "9) Delete Cloudflare account"
echo
blue "--- Cloudflare Mods ------------------------------------------------------------------------"
echo "11) WARP"
echo "12) DOH"
echo "13) DOT"
echo "14) WARP + DOH"
echo "15) WARP + DOT"
echo "16) PROXY 17) Set Proxy port"
echo
blue "--- Cloudflare Warp Info -------------------------------------------------------------------"
if [ $CLSTATUS == "TRUE" ]; then
echo "CloudFlare Warp $(warp-cli status)" | head -c -2
echo "Connection Details: ==================="
warp-cli warp-stats
else
echo
red "CloudFlare Warp Not Installed! ."
echo
fi
blue "--- Cloudflare Warp Info -------------------------------------------------------------------"
echo
yellow "Please Enter the Number ============================== ENTER 0 Back to Main-Menu =========="
echo -e "${GREEN}"
CLMENUITEMR=""
until [[ $CLMENUITEMR =~ ^[0-9]+$ ]] && [ "$CLMENUITEMR" -ge 0 ] && [ "$CLMENUITEMR" -le 99 ]; do
read -rp "$CLMENUITEMR [Please Select 0-99]: " -e CLMENUITEMR
done
#################################
case $CLMENUITEMR in
0) # EXIT
clear
mainMenuRun
;;
1) # Cloudflare Warp+ Client Details
clear
if [ $CLSTATUS == "TRUE" ]; then
warp-cli account
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
2) # Install Cloudflare Warp+
clear
if [ $CLSTATUS == "TRUE" ]; then
yellow "Cloudflare has installed allready."
else
echo "Insatlling CloudFlare Warp+"
apt --fix-broken install
apt-get upgrade
apt --fix-broken install
apt-get install desktop-file-utils nftables dirmngr gnupg gnupg-l10n gnupg-utils gnupg2 gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm libassuan0 libksba8 libnpth0 libnspr4 libnss3 libnss3-tools pinentry-curses
#apt install cloudflare-warp
###
echo "----------------------------------------------------------------------------"
echo " Enter the package link of cloudflare for your OS, default is for Ubuntu 22.04"
echo " check the site and paste latest link"
echo " -----"
apt --fix-broken install -y
echo " https://pkg.cloudflareclient.com/packages/cloudflare-warp"
mkdir -p /ExtremeDOT/
echo
DLLINK=https://pkg.cloudflareclient.com/uploads/cloudflare_warp_2023_3_398_1_amd64_ddd2a223f7.deb
DLFILE=/ExtremeDOT/cloudflare_warp.deb
read -e -i "$DLLINK" -p "Cloudflare Deb package address: " input
DLLINK="${input:-$DLLINK}"
echo "nameserver 8.8.8.8" > /etc/resolv.conf
sleep 2
curl -L $DLLINK --output $DLFILE
sleep 2
if [ -f "$DLFILE" ];
then
echo "Deab package file has downloaded."
dpkg -i $DLFILE
sleep 2
else
echo "Installation files are not downloaded, EXIT "
sleep 5
echo " check Network and Source files and retry again."
fi
warp-cli set-mode proxy
warp-cli set-proxy-port 40000
warp-cli register
warp-cli enable-always-on
warp-cli enable-connectivity-checks
fi
enter2CLmain
;;
3) #Register and Enable New Account
warp-cli register
warp-cli enable-always-on
warp-cli enable-connectivity-checks
enter2CLmain
;;
4) # Set New Licence Key
clear
if [ $CLSTATUS == "TRUE" ]; then
CL_KEY=''
read -e -i "$CL_KEY" -p "Enter Cloudflare Warp+ Account License KEY: " input
CL_KEY="${input:-$CL_KEY}"
warp-cli set-license $CL_KEY
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
8) # Get Cloudflare Network
if [ $CLSTATUS == "TRUE" ]; then
echo
echo "==========================================================="
echo
curl -4 myip.wtf/json --interface CloudflareWARP -m 10
echo
echo "==========================================================="
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
5) # Cloudflare Connect
clear
if [ $CLSTATUS == "TRUE" ]; then
warp-cli connect
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
6) # Cloudflare Disconnect
clear
if [ $CLSTATUS == "TRUE" ]; then
warp-cli disconnect
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
7) # Cloudflare Full stats
clear
if [ $CLSTATUS == "TRUE" ]; then
warp-cli warp-stats
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
9) #Delete Cloudflare account
clear
if [ $CLSTATUS == "TRUE" ]; then
warp-cli delete
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
11) #WARP
if [ $CLSTATUS == "TRUE" ]; then
warp-cli set-mode warp
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
12) #DOH
if [ $CLSTATUS == "TRUE" ]; then
warp-cli set-mode doh
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
13) #DOT
if [ $CLSTATUS == "TRUE" ]; then
warp-cli set-mode dot
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
14) #WARP + DOH
if [ $CLSTATUS == "TRUE" ]; then
warp-cli set-mode warp+doh
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
15) #WARP + DOT
if [ $CLSTATUS == "TRUE" ]; then
warp-cli set-mode warp+dot
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
16) #PROXY
if [ $CLSTATUS == "TRUE" ]; then
warp-cli set-mode proxy
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
17) # SET PORT PROXY
if [ $CLSTATUS == "TRUE" ]; then
echo
CL_ProxyPort=''
read -e -i "$CL_ProxyPort" -p "Enter port for proxy set [1000-50000]: " input
CL_ProxyPort="${input:-$CL_ProxyPort}"
warp-cli set-proxy-port $CL_ProxyPort
else
red "cloudflare-warp not found, please install it first"
fi
enter2CLmain
;;
esac
}
#####################
# MENU RETURN
function enter2main() {
read -p "Press enter to back to menu"
mainMenuRun
}
# READ STATUS
function readStatus() {
clear
echo
green "Show System Status ============================================================================="
green "Kernel Info -----"
echo -e "${YELLOW} Current Installed Kernel= `cat /proc/version | sed 's/.(.*//'`"
echo
VPSSERVER_NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)
green "Network IP Info -----"
echo -e "${YELLOW} Current IPV4= `ifconfig $VPSSERVER_NIC | grep inet | grep netmask | grep -o -P '(?<=inet ).*(?= netmask)'`"
echo -e "${YELLOW} Current IPV6= [`ifconfig $VPSSERVER_NIC | grep inet6 | grep global | grep -o -P '(?<=inet6 ).*(?= prefixlen)'`]"
echo
green "Kernel BBR Info -----"
echo -e "${YELLOW} BBR Status= `sysctl -n net.ipv4.tcp_congestion_control` - `lsmod | grep bbr`"
echo
green "Current DNS status -----"
cat /etc/resolv.conf
echo -e "${GREEN}"
}
## KERNEL
function jinwypScript() {
if test -f "/Golden1/jinwypScript/install_kernel.sh";
then
bash /Golden1/jinwypScript/install_kernel.sh
else
mkdir -p /Golden1/jinwypScript/
cd /Golden1/jinwypScript/
curl -O https://raw.githubusercontent.com/jinwyp/one_click_script/master/install_kernel.sh
chmod +x /Golden1/jinwypScript/install_kernel.sh
sleep 2
bash /Golden1/jinwypScript/install_kernel.sh
fi
}
## SOCKS PORT
clear
function portCheckCustom() {
echo
V2RAYPORT=10808
read -e -i "$V2RAYPORT" -p "Enter The V2ray Running Local Port: " input
V2RAYPORT="${input:-$V2RAYPORT}"
V2RAYPING=`curl --silent --connect-timeout 10 -m 10 --socks5 socks5://localhost:$V2RAYPORT -o /dev/null -s -w 'Total: %{time_total}s\n' google.com | cut -c 7-20`
V2RAYIP=`curl --silent --connect-timeout 10 -m 10 --socks5 socks5://localhost:$V2RAYPORT https://myip.wtf/json | grep YourFuckingIPAddress | sed 's/.*"\(.*\)".*/\1/'`
V2RAYLOCATION=`curl --silent --connect-timeout 10 -m 10 --socks5 socks5://localhost:$V2RAYPORT https://myip.wtf/json | grep YourFuckingLocation | sed 's/.*"\(.*\)".*/\1/'`
echo
echo -e "${YELLOW}Connection Name [V2RAY]= NEEDUPDATE" ;echo ""
echo -e "${RED}IP=$V2RAYIP ${GREEN}IP Location=$V2RAYLOCATION "
echo -e "${BLUE}Ping to Google=$V2RAYPING ${NC}"
echo
}
## INTERFACE CHECK
clear
function interfaceIpCheck() {
green "Listing Interfaces"
ifconfig | grep flags | awk '{print $1}' | sed 's/:$//' | grep -Ev 'lo'
green ""
interfaceName="$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)"
read -e -i "$interfaceName" -p "Please Enter the Network Interface name to check its IP: " input
interfaceName="${input:-$interfaceName}"
curl --interface $interfaceName https://myip.wtf/json
}
## showCurrentipTABLES
function showCurrentipTABLES() {
clear
iptables-save -t nat
}
## interfaceCheckCustom
clear
function interfaceCheckCustom() {
echo
customInterfaceName=xray-tun
read -e -i "$customInterfaceName" -p "Enter Interface to check running net over it: " input
customInterfaceName="${input:-$customInterfaceName}"
INTERFACEPING=`curl --connect-timeout 10 -m 10 --interface $customInterfaceName -o /dev/null -s -w 'Total: %{time_total}s\n' google.com | cut -c 7-20`
INTERFACEIP=`curl --silent --connect-timeout 10 -m 10 --interface $customInterfaceName -4 myip.wtf/json | grep YourFuckingIPAddress | sed 's/.*"\(.*\)".*/\1/'`
INTERFACELOCATION=`curl --silent --connect-timeout 10 -m 10 --interface $customInterfaceName -4 myip.wtf/json | grep YourFuckingLocation | sed 's/.*"\(.*\)".*/\1/'`
echo -e "${YELLOW}Connection Name $customInterfaceName"
echo
echo -e "${RED}IP=$INTERFACEIP ${GREEN}IP Location=$INTERFACELOCATION "
echo -e "${BLUE}Ping to Google=$INTERFACEPING ${NC}"
echo
}
## checkRunningPorts
function checkRunningPorts() {
clear
lsof -i -P -n | grep LIST
}
function getSystemStatus() {
clear
echo -e "${YELLOW}Current Installed Kernel= `cat /proc/version | sed 's/.(.*//'`"
echo -e "${YELLOW}Current IPV4= `ifconfig eth0 | grep inet | grep netmask | grep -o -P '(?<=inet ).*(?= netmask)'`"
echo -e "${YELLOW}Current IPV6= [`ifconfig eth0 | grep inet6 | grep global | grep -o -P '(?<=inet6 ).*(?= prefixlen)'`]"
}
function getBbrStatus() {
clear
green " check if bbr is running"
sysctl -n net.ipv4.tcp_congestion_control
sleep 1
lsmod | grep bbr
}
function wireGuardAngristanInstall() {
if test -f "/usr/local/bin/eXdot-WG";
then
bash /usr/local/bin/eXdot-WG
else
curl -O https://raw.githubusercontent.com/ExtremeDot/wireguard-install/extreme/wireguard-install.sh
sleep 1
chmod +x wireguard-install.sh
cp wireguard-install.sh /usr/local/bin/eXdot-WG
sleep 2
chmod +x /usr/local/bin/eXdot-WG
fi
}
function softEtherMenu() {
if test -f "/Golden1/SoftEther/softether2023.sh";
then
rm -f /Golden1/SoftEther/softether2023.sh
fi
mkdir -p /Golden1/SoftEther/
cd /Golden1/SoftEther/
curl -O https://raw.githubusercontent.com/ExtremeDot/GoldenOne_MENU/main/softether2023.sh
chmod +x /Golden1/SoftEther/softether2023.sh
bash /Golden1/SoftEther/softether2023.sh
}
# sanaee 3x script
install_acme() {
cd ~
green "install acme..."
curl https://get.acme.sh | sh
if [ $? -ne 0 ]; then
red "install acme failed"
return 1
else
green "install acme succeed"
fi
return 0
}
#method for standalone mode
ssl_cert_issue() {
#check for acme.sh first
if ! command -v ~/.acme.sh/acme.sh &>/dev/null; then
echo "acme.sh could not be found. we will install it"
install_acme
if [ $? -ne 0 ]; then
red "install acme failed, please check logs"
fi
fi
#install socat second
if [[ "${release}" == "centos" ]] || [[ "${release}" == "fedora" ]]; then
yum install socat -y
else
apt install socat -y
fi
if [ $? -ne 0 ]; then
red "install socat failed,please check logs"
else
green "install socat succeed..."
fi
ufw allow http
ufw allow https
sudo systemctl stop nginx
#get the domain here,and we need verify it
local domain=""
read -p "Please enter your domain name:" domain
yellow "your domain is:${domain},check it..."
#here we need to judge whether there exists cert already
local currentCert=$(~/.acme.sh/acme.sh --list | tail -1 | awk '{print $1}')
if [ ${currentCert} == ${domain} ]; then
local certInfo=$(~/.acme.sh/acme.sh --list)
red "system already have certs here,can not issue again,current certs details:"
green "$certInfo"
else
green "your domain is ready for issuing cert now..."
fi
#create a directory for install cert
certPath="/root/cert/${domain}"
if [ ! -d "$certPath" ]; then
mkdir -p "$certPath"
else
rm -rf "$certPath"
mkdir -p "$certPath"
fi
#get needed port here
local WebPort=80
read -p "please choose which port do you use,default will be 80 port:" WebPort
if [[ ${WebPort} -gt 65535 || ${WebPort} -lt 1 ]]; then
red "your input ${WebPort} is invalid,will use default port"
fi
green "will use port:${WebPort} to issue certs,please make sure this port is open..."
#NOTE:This should be handled by user
#open the port and kill the occupied progress
~/.acme.sh/acme.sh --set-default-ca --server letsencrypt
~/.acme.sh/acme.sh --issue -d ${domain} --standalone --httpport ${WebPort}
if [ $? -ne 0 ]; then
red "issue certs failed,please check logs"
rm -rf ~/.acme.sh/${domain}
else
red "issue certs succeed,installing certs..."
fi
#install cert
~/.acme.sh/acme.sh --installcert -d ${domain} \
--key-file /root/cert/${domain}/privkey.pem \
--fullchain-file /root/cert/${domain}/fullchain.pem
if [ $? -ne 0 ]; then
red "install certs failed,exit"
rm -rf ~/.acme.sh/${domain}
else
green "install certs succeed,enable auto renew..."
fi
~/.acme.sh/acme.sh --upgrade --auto-upgrade
if [ $? -ne 0 ]; then
red "auto renew failed, certs details:"
ls -lah cert/*
chmod 755 $certPath/*
else
green "auto renew succeed, certs details:"
ls -lah cert/*
chmod 755 $certPath/*
fi
green " - - - FINISH - - - - - - - - - - - - - - - - - - - - - - - "
green "============================================================"
green " - Panel certificate public key file path address:"
green " - [ /root/cert/${domain}/fullchain.pem ]"
echo
echo
green " - Panel certificate key file path: "
green " - [ /root/cert/${domain}/privkey.pem ]"
echo
green "============================================================"
echo
sudo systemctl restart nginx
}
function mainMenuRun() {
#MAIN MENU SCRIPt
echo "nameserver 8.8.8.8" > /etc/resolv.conf
echo -e "${GREEN}"
yellow "=== EXTREME DOT - Multi VPN Installer MENU ============================================[Version $scriptVersion]"
blue "--- Initial Setup -----------------------------------------------------------------------------------"
echo "1) System Status & Show Status 6) Show Busy/Used Ports by System"
echo "2) JINWYP Kernel Tuner Script 7) Show Current IPTABLES ROUTING"
echo "3) Edit SSH config file 8) Check Public IP by Socks5 Port's Number"
echo "4) GET BBR STATUS 9) Check Public IP by Interface's Name"
echo "5) All Network Interfaces 10) Set DNS Setting Permanently"
blue "--- VPN Protocoles Menu -----------------------------------------------------------------------------"
echo "11) CloudFlare WARP+ 16) Install SSl certificate"
echo "12) WireGuard 17) Install IRAN geo dat"
echo "13) OpenVPN 18) Mack-A v2ray-agent Script"
echo "14) SoftEther 19) Install Sanaee 3X-UI Panel"
echo "15) V2RAY, XRAY 20) Install FranzKafkaYu Panel"
blue "--- MultiBalance Menu -------------------------------------------------------------------------------"
echo
echo "0) EXIT 98) Reboot Linux 99) Update eMenu Script"
yellow "Please Enter the Number ============================================================================="
echo -e "${GREEN}"
MENUITEMR=""
until [[ $MENUITEMR =~ ^[0-9]+$ ]] && [ "$MENUITEMR" -ge 0 ] && [ "$MENUITEMR" -le 99 ]; do
read -rp "$MENUITEMR [Please Select 0-99]: " -e MENUITEMR
done
#################################
case $MENUITEMR in
0) # EXIT
echo -e "${NC}"
exit
;;
1) # System Status
readStatus
enter2main
;;
2) # Install JINWYP Kernel Tuner Script
jinwypScript
enter2main
;;
3) #Edit SSH config file"
green "Editing sshd Config"
nano /etc/ssh/sshd_config
green "Restarting SSH Service"
systemctl restart sshd
enter2main
;;
4) #GET BBR STATUS
getBbrStatus
enter2main
;;
5) # All Network Interfaces
clear
echo "------------------------------------------"
echo "---Network List"
ifconfig | grep flags | awk '{print $1}' | sed 's/:$//'
echo
echo "------------------------------------------"
enter2main
;;
6) # Show Busy/Used Ports by System
checkRunningPorts
enter2main
;;
7) # Show Current IPTABLES ROUTING
showCurrentipTABLES
enter2main
;;
8) #Check Public IP by Socks5 Port's Number
portCheckCustom
enter2main
;;
9) #Check Public IP by Interface's Name
interfaceCheckCustom
enter2main
;;
10)
setDNSpermanent
enter2main
;;
11)
cloudflaremenu
enter2main
;;
12)
wireGuardAngristanInstall
enter2main
;;
14)
softEtherMenu
enter2main
;;
16)
ssl_cert_issue
enter2main
;;
17)
cd /usr/local/x-ui/bin
systemctl stop x-ui
sleep 2
wget -N https://github.com/bootmortis/iran-hosted-domains/releases/latest/download/iran.dat
chmod 755 /usr/local/x-ui/bin/iran.dat
sleep 1
systemctl start x-ui
enter2main
;;
18)
rm -f /root/install.sh
wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh
enter2main
;;
19)
bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh)
enter2main
;;
20)
bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install_en.sh)
enter2main
;;
98) #reboot
reboot
;;
99) #update
updateTheScript
;;
esac
}
firstStart
clear
mainMenuRun
echo -e "${NC}"