-
Notifications
You must be signed in to change notification settings - Fork 0
/
nmfas.sh
1215 lines (1161 loc) · 41.9 KB
/
nmfas.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
1000
#!/bin/bash
#Semi尼玛QQ:154477274 QQ群:104911190
#Semi尼玛FAS破解系统
function fhqcz() {
#关闭SELinux
setenforce 0 >/dev/null 2>&1
if [ ! -f /etc/selinux/config ]; then
echo "警告!SELinux关闭失败,请自行检查SELinux关键模块是否存在!脚本停止!"
exit
fi
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
iptables -F
service iptables save >/dev/null 2>&1
systemctl restart iptables.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!IPtables重启失败!请手动重启IPtables查看失败原因!脚本停止!"
exit
fi
iptables -A INPUT -s 127.0.0.1/32 -j ACCEPT
iptables -A INPUT -d 127.0.0.1/32 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport $Apacheport -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 440 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 3389 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1024 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 137 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 137 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1194 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1195 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1196 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1197 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 137 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 138 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 53 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A PREROUTING -p udp --dport 138 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p udp --dport 137 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p udp --dport 1194 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p udp --dport 1195 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p udp --dport 1196 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p udp --dport 1197 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING --dst 10.8.0.1 -p udp --dport 53 -j DNAT --to-destination 10.8.0.1:5353
iptables -t nat -A PREROUTING --dst 10.9.0.1 -p udp --dport 53 -j DNAT --to-destination 10.9.0.1:5353
iptables -t nat -A PREROUTING --dst 10.10.0.1 -p udp --dport 53 -j DNAT --to-destination 10.10.0.1:5353
iptables -t nat -A PREROUTING --dst 10.11.0.1 -p udp --dport 53 -j DNAT --to-destination 10.11.0.1:5353
iptables -t nat -A PREROUTING --dst 10.12.0.1 -p udp --dport 53 -j DNAT --to-destination 10.12.0.1:5353
iptables -A INPUT -p udp -m udp --dport 5353 -j ACCEPT
iptables -P INPUT DROP
iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -j MASQUERADE
iptables -t nat -A POSTROUTING -j MASQUERADE
service iptables save >/dev/null 2>&1
systemctl restart iptables.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!IPtables重启失败!请手动重启IPtables查看失败原因!脚本停止!"
exit
fi
echo
echo "防火墙已重置完成!"
}
function ly01() {
#关闭SELinux
setenforce 0 >/dev/null 2>&1
if [ ! -f /etc/selinux/config ]; then
#echo "SELinux检测不到的,关闭不掉的,或关闭失败的,请自行联系破解作者解决!"
echo "警告!SELinux关闭失败,请自行检查SELinux关键模块是否存在!脚本停止!"
exit
fi
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
#下载IP路由转发配置
rm -rf /etc/sysctl.conf
wget -q ${http}${host}${ly863963860}sysctl.conf -P /etc
if [ ! -f /etc/sysctl.conf ]; then
echo "警告!IP路由转发配置文件下载失败,请自行检查下载源是否可用!脚本停止!"
exit
fi
sysctl -p /etc/sysctl.conf >/dev/null 2>&1
#停止firewalld防火墙
systemctl stop firewalld.service >/dev/null 2>&1
#禁用firewalld防火墙
systemctl disable firewalld.service >/dev/null 2>&1
#尝试停止iptables防火墙
systemctl stop iptables.service >/dev/null 2>&1
#安装iptables防火墙
yum -y install iptables iptables-services >/dev/null 2>&1
#启动iptables防火墙
systemctl start iptables.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!IPtables启动失败!请手动重启IPtables查看失败原因!脚本停止!"
exit
fi
#清空iptables防火墙配置
iptables -F
service iptables save >/dev/null 2>&1
systemctl restart iptables.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!IPtables重启失败!请手动重启IPtables查看失败原因!脚本停止!"
exit
fi
iptables -A INPUT -s 127.0.0.1/32 -j ACCEPT
iptables -A INPUT -d 127.0.0.1/32 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport $lyApacheport -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 440 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 3389 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1024 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1194 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1195 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1196 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 1197 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 138 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 137 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 137 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 138 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 53 -j ACCEPT
iptables -A INPUT -p udp -m udp --dport 5353 -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A PREROUTING -p udp --dport 138 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p udp --dport 137 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p udp --dport 1194 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p udp --dport 1195 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p udp --dport 1196 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING -p udp --dport 1197 -j REDIRECT --to-ports 53
#iptables -t nat -I PREROUTING -p udp --dport 5353 -j REDIRECT --to-ports 53
iptables -t nat -A PREROUTING --dst 10.8.0.1 -p udp --dport 53 -j DNAT --to-destination 10.8.0.1:5353
iptables -t nat -A PREROUTING --dst 10.9.0.1 -p udp --dport 53 -j DNAT --to-destination 10.9.0.1:5353
iptables -t nat -A PREROUTING --dst 10.10.0.1 -p udp --dport 53 -j DNAT --to-destination 10.10.0.1:5353
iptables -t nat -A PREROUTING --dst 10.11.0.1 -p udp --dport 53 -j DNAT --to-destination 10.11.0.1:5353
iptables -t nat -A PREROUTING --dst 10.12.0.1 -p udp --dport 53 -j DNAT --to-destination 10.12.0.1:5353
iptables -A INPUT -p udp -m udp --dport 5353 -j ACCEPT
iptables -P INPUT DROP
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.9.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.10.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.11.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.12.0.0/24 -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -j MASQUERADE
service iptables save >/dev/null 2>&1
systemctl restart iptables.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!IPtables重启失败!请手动重启IPtables查看失败原因!脚本停止!"
exit;0
fi
systemctl enable iptables.service >/dev/null 2>&1
}
function ly02() {
#--force --nodeps
#安装epel仓库
yum -y install epel-release
#yum -y install openssl openssl-libs openssl-devel lzo lzo-devel pam pam-devel automake pkgconfig gawk tar zip unzip net-tools psmisc gcc httpd libxml2 libxml2-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel dnsmasq iptables iptables-services
#安装官方所需环境
yum -y install telnet avahi openssl openssl-libs openssl-devel lzo lzo-devel pam pam-devel automake pkgconfig gawk tar zip unzip net-tools psmisc gcc pkcs11-helper mariadb mariadb-server httpd libxml2 libxml2-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel dnsmasq jre-1.7.0-openjdk
#安装PHP环境(这里使用的是第三方PHP安装源,并非官方安装源,此项并不影响正常安装使用使用)
#安装PHP7.0,暂时不考虑PHP7.1 反正够用了,如您业务需要,请自行卸载PHP7.0版本安装PHP7.1版本即可
rpm -Uvh ${http}${host}${ly863963860}webtatic-release.rpm
yum install php70w php70w-fpm php70w-bcmath php70w-cli php70w-common php70w-dba php70w-devel php70w-embedded php70w-enchant php70w-gd php70w-imap php70w-ldap php70w-mbstring php70w-mcrypt php70w-mysqlnd php70w-odbc php70w-opcache php70w-pdo php70w-pdo_dblib php70w-pear.noarch php70w-pecl-apcu php70w-pecl-apcu-devel php70w-pecl-imagick php70w-pecl-imagick-devel php70w-pecl-mongodb php70w-pecl-redis php70w-pecl-xdebug php70w-pgsql php70w-xml php70w-xmlrpc php70w-intl php70w-mcrypt --nogpgcheck php-fedora-autoloader php-php-gettext php-tcpdf php-tcpdf-dejavu-sans-fonts php70w-tidy -y
#安装openvpn.rpm所需环境!
rpm -Uvh ${http}${host}${ly863963860}liblz4-1.8.1.2-alt1.x86_64.rpm
#这里使用的是非官方的openvpn源,由于官方的openvpn2.4.3的rpm包找不到,只能采用最新版的2.4.6的rpm包
rpm -Uvh ${http}${host}${ly863963860}openvpn-2.4.6-1.el7.x86_64.rpm
}
function ly03() {
systemctl start mariadb.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!MariaDB初始化失败!请手动启动MariaDB查看失败原因!脚本停止!"
exit;0
fi
mysqladmin -u root password "$lysqlpass" #创建数据库密码
mysql -u root -p$lysqlpass -e "create database vpndata;" #创建vpndata数据表
#mysql -u root -p$lysqlpass -e "drop database test;" #删除默认test数据库
systemctl restart mariadb.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!MariaDB重启失败!请手动重启MariaDB查看失败原因!脚本停止!"
exit;0
fi
systemctl enable mariadb.service >/dev/null 2>&1
}
function ly04() {
#修改Apache端口 修改主机名
sed -i "s/#ServerName www.example.com:80/ServerName localhost:$lyApacheport/g" /etc/httpd/conf/httpd.conf
sed -i "s/Listen 80/Listen $lyApacheport/g" /etc/httpd/conf/httpd.conf
setenforce 0 >/dev/null 2>&1
systemctl start httpd.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!Apache启动失败!请手动启动Apache查看失败原因!脚本停止!"
exit;0
fi
systemctl enable httpd.service >/dev/null 2>&1
#由于PHP问题,需要添加第三方数据库支持,请勿删除,否则phpMyAdmin无法打开!
cat >> /etc/php.ini <<EOF
extension=php_mcrypt.dll
extension=php_mysqli.dll
EOF
systemctl start php-fpm.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!PHP启动失败!请手动启动PHP查看失败原因!脚本停止!"
exit;0
fi
systemctl enable php-fpm.service >/dev/null 2>&1
}
function ly05() {
if [ ! -d /etc/openvpn ]; then
echo "警告!OpenVPN安装失败,请自行检查rpm包下载源是否可用!脚本停止!"
exit;0
fi
cd /etc/openvpn && rm -rf /etc/openvpn/*
wget -q ${http}${host}${ly863963860}openvpn.zip
if [ ! -f /etc/openvpn/openvpn.zip ]; then
echo "警告!OpenVPN配置文件下载失败,请自行检查下载源是否可用!脚本停止!"
exit;0
fi
unzip -o openvpn.zip >/dev/null 2>&1
rm -rf openvpn.zip && chmod 0777 -R /etc/openvpn
sed -i "s/newpass/"$lysqlpass"/g" /etc/openvpn/auth_config.conf
sed -i "s/服务器IP/"$IP"/g" /etc/openvpn/auth_config.conf
systemctl enable [email protected] >/dev/null 2>&1
systemctl enable [email protected] >/dev/null 2>&1
systemctl enable [email protected] >/dev/null 2>&1
systemctl enable [email protected] >/dev/null 2>&1
systemctl enable [email protected] >/dev/null 2>&1
}
function ly06() {
if [ ! -f /etc/dnsmasq.conf ]; then
echo "警告!dnsmasq安装失败,请自行检查dnsmasq是否安装正确!脚本停止!"
exit;0
fi
rm -rf /etc/dnsmasq.conf
wget -q ${http}${host}${ly863963860}dnsmasq.conf -P /etc && chmod 0777 /etc/dnsmasq.conf
if [ ! -f /etc/dnsmasq.conf ]; then
echo "警告!dnsmasq配置文件下载失败,请自行检查下载源是否可用!脚本停止!"
exit;0
fi
systemctl enable dnsmasq.service >/dev/null 2>&1
}
function web() {
#安装web云端
rm -rf /var/www/* && cd /var/www && wget -q http://lingyi3.nos-eastchina1.126.net/fas_web.zip #http://lingyi3.nos-eastchina1.126.net/fas_web.zip #${http}${host}${ly863963860}fas_web.zip
if [ ! -f /var/www/fas_web.zip ]; then
echo "警告!FAS-WEB配置文件下载失败,请自行检查下载源是否可用!脚本停止!"
exit;0
fi
unzip -o fas_web.zip >/dev/null 2>&1 && rm -rf fas_web.zip && chmod 0777 -R /var/www/html
#导入数据库vpndata表数据
sed -i "s/lyfasadmin/"$lyadminuser"/g" /var/www/vpndata.sql
sed -i "s/lyfaspass/"$lyadminpass"/g" /var/www/vpndata.sql
sed -i "s/服务器IP/"$IP"/g" /var/www/vpndata.sql
mysql -uroot -p$lysqlpass vpndata < /var/www/vpndata.sql
rm -rf /var/www/vpndata.sql
#修改后台名
mv /var/www/html/fassql /var/www/html/$lysqldizhi
sed -i "s/newpass/"$lysqlpass"/g" /var/www/html/config.php
#添加本地随机密钥
echo "$RANDOM$RANDOM">>/var/www/auth_key.access
}
function sbin() {
#新建带宽监控数据文件夹
mkdir /etc/rate.d/ && chmod -R 0777 /etc/rate.d/
#更新命令指示符
cd /root&&wget -q ${http}${host}${ly863963860}res.zip
if [ ! -f /root/res.zip ]; then
echo "警告!FAS-res配置文件下载失败,请自行检查下载源是否可用!脚本停止!"
exit;0
fi
unzip -o res.zip >/dev/null 2>&1 && chmod -R 0777 /root && rm -rf /root/res.zip
mv /root/res/fas.service /lib/systemd/system/fas.service && chmod -R 0777 /lib/systemd/system/fas.service && systemctl enable fas.service >/dev/null 2>&1
cd /bin && wget -q ${http}${host}${ly863963860}bin.zip
if [ ! -f /bin/bin.zip ]; then
echo "警告!FAS命令指示符配置文件下载失败,请自行检查下载源是否可用!脚本停止!"
exit;0
fi
unzip -o bin.zip >/dev/null 2>&1 && rm -rf /bin/bin.zip && chmod -R 0777 /bin
#新建自定义屏蔽host文件
echo 'FAS系统自定义屏蔽host文件
'>>/etc/fas_host && chmod 0777 /etc/fas_host
}
function qidongya() {
#启动所有服务
systemctl restart iptables.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!IPtables重启失败!请手动重启IPtables查看失败原因!脚本停止!"
exit;0
fi
systemctl restart mariadb.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!MariaDB重启失败!请手动重启MariaDB查看失败原因!脚本停止!"
exit;0
fi
systemctl restart httpd.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!Apache启动失败!请手动启动Apache查看失败原因!脚本停止!"
exit;0
fi
systemctl restart php-fpm.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!PHP启动失败!请手动启动PHP查看失败原因!脚本停止!"
exit;0
fi
systemctl restart dnsmasq.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!DNSmasq启动失败!请手动启动DNSmasq查看失败原因!脚本停止!"
exit;0
fi
systemctl restart [email protected] >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!openvpn@server1194服务启动失败!请手动启动openvpn@server1194服务查看失败原因!脚本停止!"
exit;0
fi
systemctl restart [email protected] >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!openvpn@server1195服务启动失败!请手动启动openvpn@server1195服务查看失败原因!脚本停止!"
exit;0
fi
systemctl restart [email protected] >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!openvpn@server1196服务启动失败!请手动启动openvpn@server1196服务查看失败原因!脚本停止!"
exit;0
fi
systemctl restart [email protected] >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!openvpn@server1197服务启动失败!请手动启动openvpn@server1197服务查看失败原因!脚本停止!"
exit;0
fi
systemctl restart [email protected] >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!openvpn@server-udp服务启动失败!请手动启动openvpn@server-udp服务查看失败原因!脚本停止!"
exit;0
fi
systemctl restart fas.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!Fas服务启动失败!请手动启动Fas服务查看失败原因!脚本停止!"
exit;0
fi
dhclient >/dev/null 2>&1
vpn restart >/dev/null 2>&1
}
function Installation() {
#安装单独APP制作环境
yum install jre-1.7.0-openjdk unzip zip wget curl -y >/dev/null 2>&1
}
function app1() {
rm -rf /APP
mkdir /APP >/dev/null 2>&1
cd /APP
#wget -q ${http}${host}${ly863963860}fas.apk&&wget -q ${http}${host}${ly863963860}apktool.jar&&java -jar apktool.jar d fas.apk >/dev/null 2>&1&&rm -rf fas.apk
wget -q https://gitee.com/seminima/fas/blob/master/fas.apk&&wget -q https://gitee.com/seminima/fas/blob/master/apktool.jar&&java -jar apktool.jar d fas.apk >/dev/null 2>&1&&rm -rf fas.apk
sed -i 's/demo.dingd.cn:80/'${llwsIP}:${lyApacheport}'/g' `grep demo.dingd.cn:80 -rl /APP/fas/smali/net/openvpn/openvpn/`
sed -i 's/叮咚流量卫士/'${llwsname}'/g' "/APP/fas/res/values/strings.xml"
sed -i 's/net.dingd.vpn/'${llwsbaoming}'/g' "/APP/fas/AndroidManifest.xml"
java -jar apktool.jar b fas >/dev/null 2>&1
wget -q ${http}${host}${ly863963860}signer.zip&&unzip -o signer.zip >/dev/null 2>&1
mv /APP/fas/dist/fas.apk /APP/fas.apk
java -jar signapk.jar testkey.x509.pem testkey.pk8 /APP/fas.apk /APP/fas_sign.apk >/dev/null 2>&1
cp -rf /APP/fas_sign.apk /root/fasapp_by_ly.apk
rm -rf /APP
if [ ! -f /root/fasapp_by_ly.apk ]; then
echo
echo "FAS系统APP制作失败!"
echo
echo "请自行前往官方交流群获取手动对接APP源!"
echo
echo "官方交流群:104911190 欢迎你的加入!"
exit;0
fi
}
function app() {
#制作APP
rm -rf /APP
mkdir /APP >/dev/null 2>&1
cd /APP
#wget -q ${http}${host}${ly863963860}fas.apk&&wget -q ${http}${host}${ly863963860}apktool.jar&&java -jar apktool.jar d fas.apk >/dev/null 2>&1&&rm -rf fas.apk
wget -q https://gitee.com/seminima/fas/blob/master/fas.apk&&wget -q https://gitee.com/seminima/fas/blob/master/apktool.jar&&java -jar apktool.jar d fas.apk >/dev/null 2>&1&&rm -rf fas.apk
sed -i 's/demo.dingd.cn:80/'${llwsIP}:${lyApacheport}'/g' `grep demo.dingd.cn:80 -rl /APP/fas/smali/net/openvpn/openvpn/`
sed -i 's/叮咚流量卫士/'${llwsname}'/g' "/APP/fas/res/values/strings.xml"
sed -i 's/net.dingd.vpn/'${llwsbaoming}'/g' "/APP/fas/AndroidManifest.xml"
java -jar apktool.jar b fas >/dev/null 2>&1
wget -q ${http}${host}${ly863963860}signer.zip&&unzip -o signer.zip >/dev/null 2>&1
mv /APP/fas/dist/fas.apk /APP/fas.apk
java -jar signapk.jar testkey.x509.pem testkey.pk8 /APP/fas.apk /APP/fas_sign.apk >/dev/null 2>&1
cp -rf /APP/fas_sign.apk /var/www/html/fasapp_by_ly.apk
rm -rf /APP
if [ ! -f /var/www/html/fasapp_by_ly.apk ]; then
echo
echo "FAS系统APP制作失败!"
echo
echo "请自行前往官方交流群获取手动对接APP源!"
echo
echo "官方交流群:104911190 欢迎你的加入!"
fi
}
function zhuji() {
clear
echo
read -p "请输入本机数据库地址(localhost): " lysqlip
if [ -z "$lysqlip" ];then
lysqlip=localhost
fi
echo
read -p "请输入本机数据库端口(3306): " lysqlport
if [ -z "$lysqlport" ];then
lysqlport=3306
fi
echo
read -p "请输入本机数据库账号(root): " lysqluser
if [ -z "$lysqluser" ];then
lysqluser=root
fi
echo
read -p "请输入本机数据库密码: " lysqlpass
if [ -z "$lysqlpass" ];then
lysqlpass=
fi
echo
echo "正在为您的系统进行负载,请稍等......"
sleep 3
SQL_RESULT=`mysql -h${lysqlip} -P${lysqlport} -u${lysqluser} -p${lysqlpass} -e quit 2>&1`;
SQL_RESULT_LEN=${#SQL_RESULT};
if [[ !${SQL_RESULT_LEN} -eq 0 ]];then
echo
echo "数据库连接失败,请检查您的数据库密码后重试,脚本停止!";
exit;
fi
iptables -A INPUT -p tcp -m tcp --dport $lysqlport -j ACCEPT
service iptables save >/dev/null 2>&1
systemctl restart iptables.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!IPtables重启失败!请手动重启IPtables查看失败原因!脚本停止!"
exit
fi
mysql -h${lysqlip} -P${lysqlport} -u${lysqluser} -p${lysqlpass} <<EOF
grant all privileges on *.* to '${lysqluser}'@'%' identified by '${lysqlpass}' with grant option;
flush privileges;
EOF
systemctl restart mariadb.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!MariaDB重启失败!请手动重启MariaDB查看失败原因!脚本停止!"
exit
fi
sleep 5
echo
echo "已成功为您的系统进行负载!您可以在任何搭载FAS系统机器上对接至本服务器!"
}
function port123() {
clear
echo -e "请选择协议类型(本程序仅适用于FAS系统):"
echo -e "1. TCP 代理端口"
echo -e "2. UDP 直连端口(将转发至53端口)"
read install_type
echo -n "请输入端口号(0-65535):"
read port
if [ $install_type == 1 ];then
/root/res/proxy.bin -l $port -d
read has < <(cat /etc/sysconfig/iptables | grep "tcp \-\-dport $port \-j ACCEPT" )
if [ -z "$has" ];then
iptables -A INPUT -p tcp -m tcp --dport $port -j ACCEPT
service iptables save
echo -e "[添加tcp $port 至防火墙白名单]"
fi
read has2 < <(cat /root/res/portlist.conf | grep "port $port tcp" )
if [ -z "$has2" ];then
echo -e "port $port tcp">>/root/res/portlist.conf
fi
echo -e "[已经成功添加代理端口]"
else
read has < <(cat /etc/sysconfig/iptables | grep "udp \-\-dport $port \-j ACCEPT" )
if [ -z "$has" ];then
iptables -A INPUT -p udp -m udp --dport $port -j ACCEPT
service iptables save
echo -e "[添加tcp $port 至防火墙白名单]"
fi
iptables -t nat -A PREROUTING -p udp --dport $port -j REDIRECT --to-ports 53 && service iptables save
echo -e "[已将此端口转发至53 UDP端口]"
fi
echo "感谢使用 再见!"
exit;0
}
function fuji() {
clear
echo
read -p "请输入本机IP: " lybenjiip
if [ -z "$lybenjiip" ];then
lybenjiip=
fi
echo
read -p "请输入主机IP: " lysqlip
if [ -z "$lysqlip" ];then
lysqlip=
fi
echo
read -p "请输入主机数据库端口: " lysqlport
if [ -z "$lysqlport" ];then
lysqlport=
fi
echo
read -p "请输入主机数据库账号: " lysqluser
if [ -z "$lysqluser" ];then
lysqluser=
fi
echo
read -p "请输入主机数据库密码: " lysqlpass
if [ -z "$lysqlpass" ];then
lysqlpass=
fi
echo
echo "正在为您的系统进行负载,请稍等......"
sleep 3
SQL_RESULT=`mysql -h${lysqlip} -P${lysqlport} -u${lysqluser} -p${lysqlpass} -e quit 2>&1`;
SQL_RESULT_LEN=${#SQL_RESULT};
if [[ !${SQL_RESULT_LEN} -eq 0 ]];then
echo
echo "连接至主机数据库失败,请检查您的主机数据库密码后重试,脚本停止!";
exit;
fi
rm -rf /etc/openvpn/auth_config.conf
echo '#!/bin/bash
#兼容配置文件 此文件格式既可以适应shell也可以适应FasAUTH,但是这里不能使用变量,也不是真的SHELL文件,不要写任何shell在这个文件
#FAS监控系统配置文件
#请谨慎修改
#数据库地址
mysql_host='$lysqlip'
#数据库用户
mysql_user='$lysqluser'
#数据库密码
mysql_pass='$lysqlpass'
#数据库端口
mysql_port='$lysqlport'
#数据库表名
mysql_data=vpndata
#本机地址
address='$lybenjiip'
#指定异常记录回收时间 单位s 600即为十分钟
unset_time=600
#删除僵尸记录地址
del="/root/res/del"
#进程1监控地址
status_file_1="/var/www/html/openvpn_api/online_1194.txt 7075 1194 tcp-server"
status_file_2="/var/www/html/openvpn_api/online_1195.txt 7076 1195 tcp-server"
status_file_3="/var/www/html/openvpn_api/online_1196.txt 7077 1196 tcp-server"
status_file_4="/var/www/html/openvpn_api/online_1197.txt 7078 1197 tcp-server"
status_file_5="/var/www/html/openvpn_api/user-status-udp.txt 7079 53 udp"
#睡眠时间
sleep=3'>/etc/openvpn/auth_config.conf && chmod -R 0777 /etc/openvpn/auth_config.conf
rm -rf /var/www/html/config.php
echo '<?php
/* 本文件由系统自动生成 如非必要 请勿修改 */
define("_host_","'$lysqlip'");
define("_user_","'$lysqluser'");
define("_pass_","'$lysqlpass'");
define("_port_","'$lysqlport'");
define("_ov_","vpndata");
define("_openvpn_","openvpn");
define("_iuser_","iuser");
define("_ipass_","pass");
define("_isent_","isent");
define("_irecv_","irecv");
define("_starttime_","starttime");
define("_endtime_","endtime");
define("_maxll_","maxll");
define("_other_","dlid,tian");
define("_i_","i");'>/var/www/html/config.php && chmod -R 0777 /var/www/html/config.php
systemctl stop mariadb.service >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "" >/dev/null 2>&1
else
echo "警告!MariaDB停止失败!请手动停止MariaDB查看失败原因!脚本停止!"
exit;0
fi
sleep 5
echo
echo "已成功为您的系统进行负载!主机IP为:"$lysqlip"!"
echo
echo "副机系统请前往shell控制台输入 unfas、unsql 关闭后台登录权限,以防被不法份子入侵系统!"
echo
echo "请您及时前往主机FAS后台管理添加本机,本机IP: "$lybenjiip""
}
function menufuzai() {
clear
echo
echo -e "************************************************"
echo -e " 欢迎使用FAS系统快速负载助手 "
echo -e "************************************************"
echo -e "请选择:"
echo
echo -e "\033[36m 1、主机开启远程连接权限\033[0m \033[31m(主机只需开启一次,后续直接副机对接主机即可)\033[0m"
echo
echo -e "\033[36m 2、副机连接主机数据库\033[0m \033[31m(在副机执行,每个机子无限负载主机,仅生效最后一次负载的机器)\033[0m"
echo
echo -e "\033[36m 3、退出脚本!\033[0m"
echo
echo
read -p " 请输入安装选项并回车: " a
echo
echo
k=$a
if [[ $k == 1 ]];then
zhuji
exit;0
fi
if [[ $k == 2 ]];then
fuji
exit;0
fi
if [[ $k == 3 ]];then
echo
echo "感谢您的使用,再见!"
exit;0
fi
echo -e "\033[31m 输入错误!请重新运行脚本!\033[0m "
exit;0
}
function done1() {
#完成安装
#变量查看随机密码
suiji=$( cat /var/www/auth_key.access )
#锁定数据库后台
unsql >/dev/null 2>&1
clear
echo "---------------------------------------------"
echo "---------------------------------------------"
echo "恭喜,您已经安装完毕。"
echo "控制台: http://"$IP":"$lyApacheport"/admin/"
echo "账号: "$lyadminuser" 密码: "$lyadminpass""
echo "控制台随机本地密钥: "$suiji""
echo "内置数据库管理: http://"$IP":"$lyApacheport"/"$lysqldizhi"/"
echo "---------------------------------------------"
echo "数据库账户: root 密码: "$lysqlpass" "
echo "代理控制台: http://"$IP":"$lyApacheport"/daili"
echo "---------------------------------------------"
echo "常用指令: "
echo "重启VPN vpn restart FAS后台开启:onfas "
echo "启动VPN vpn start FAS后台关闭:unfas "
echo "停止VPN vpn stop 数据库开启:onsql "
echo "开任意端口 port 数据库关闭:unsql "
echo "---------------------------------------------"
echo "APP下载地址: http://"$IP":"$lyApacheport"/fasapp_by_ly.apk"
echo "FAS破解作者: 尼玛 QQ:863963860 "
echo "官方交流群:104911190 欢迎你的加入! "
echo "---------------------------------------------"
echo "---------------------------------------------"
exit;0
}
function infoapp() {
clear
echo
read -p "请设置APP名称(默认:流量卫士): " llwsname
if [ -z "$llwsname" ];then
llwsname=流量卫士
fi
echo -e "已设置APP名称为:\033[32m "$llwsname"\033[0m"
echo
read -p "请设置APP解析地址(可输入域名或IP,不带http://): " llwsIP
if [ -z "$llwsIP" ];then
llwsIP=`curl -s http://members.3322.org/dyndns/getip`;
fi
echo -e "已设置APP解析地址为:\033[32m "$llwsIP"\033[0m"
echo
read -p "请设置APP端口(默认:1024): " lyApacheport
if [ -z "$lyApacheport" ];then
lyApacheport=1024
fi
echo -e "已设置APP端口为:\033[32m "$lyApacheport"\033[0m"
echo
read -p "请设置APP包名(默认:net.dingd.vpn): " llwsbaoming
if [ -z "$llwsbaoming" ];then
llwsbaoming=net.dingd.vpn
fi
echo -e "已设置APP包名为:\033[32m "$llwsbaoming"\033[0m"
sleep 2
clear
sleep 2
echo -e "\033[1;32m制作开始...\033[0m"
sleep 5
}
function fashoutaijiance() {
if [ $lysqldizhi == phpMyAdmin ];then
lysqldizhi=`date +%s%N | md5sum | head -c 20 ; echo`;
echo -e "系统检测到您输入的数据库后台地址为phpMyAdmin,为了您的服务器安全,系统已默认修改您的数据库后台地址为: \033[32m"$lysqldizhi"\033[0m";
echo
sleep 3
else
echo "" >/dev/null 2>&1
fi
if [ $lysqldizhi == llws ];then
lysqldizhi=`date +%s%N | md5sum | head -c 20 ; echo`;
echo -e "系统检测到您输入的数据库后台地址为llws,为了您的服务器安全,系统已默认修改您的数据库后台地址为: \033[32m"$lysqldizhi"\033[0m";
echo
sleep 3
else
echo "" >/dev/null 2>&1
fi
if [ $lysqldizhi == phpmyadmin ];then
lysqldizhi=`date +%s%N | md5sum | head -c 20 ; echo`;
echo -e "系统检测到您输入的数据库后台地址为phpmyadmin,为了您的服务器安全,系统已默认修改您的数据库后台地址为: \033[32m"$lysqldizhi"\033[0m";
echo
sleep 3
else
echo "" >/dev/null 2>&1
fi
if [ $lysqldizhi == sql ];then
lysqldizhi=`date +%s%N | md5sum | head -c 20 ; echo`;
echo -e "系统检测到您输入的数据库后台地址为sql,为了您的服务器安全,系统已默认修改您的数据库后台地址为: \033[32m"$lysqldizhi"\033[0m";
echo
sleep 3
else
echo "" >/dev/null 2>&1
fi
if [ $lysqldizhi == admin ];then
lysqldizhi=`date +%s%N | md5sum | head -c 20 ; echo`;
echo -e "系统检测到您输入的数据库后台地址为admin,为了您的服务器安全,系统已默认修改您的数据库后台地址为: \033[32m"$lysqldizhi"\033[0m";
echo
sleep 3
else
echo "" >/dev/null 2>&1
fi
}
function infofas() {
clear
echo
echo -e "\033[1;42;37m尊敬的用户您好,搭建FAS系统之前请您先自定义以下信息,如不会填写请直接回车默认即可!\033[0m"
echo
sleep 1
read -p "请设置后台账号(默认admin): " lyadminuser
if [ -z "$lyadminuser" ];then
lyadminuser=admin
fi
echo -e "已设置后台账号为:\033[32m "$lyadminuser"\033[0m"
echo
read -p "请设置后台密码(默认随机): " lyadminpass
if [ -z "$lyadminpass" ];then
lyadminpass=`date +%s%N | md5sum | head -c 20 ; echo`;
fi
echo -e "已设置后台密码为:\033[32m "$lyadminpass"\033[0m"
echo
read -p "请设置后台端口(默认1024): " lyApacheport
if [ -z "$lyApacheport" ];then
lyApacheport=1024
fi
echo -e "已设置后台端口为:\033[32m http://"$IP":"$lyApacheport"\033[0m"
echo
read -p "请设置数据库地址(默认随机,禁用phpMyAdmin): " lysqldizhi
if [ -z "$lysqldizhi" ];then
lysqldizhi=`date +%s%N | md5sum | head -c 20 ; echo`;
fi
echo -e "已设置数据库地址为:\033[32m http://"$IP":"$lyApacheport"/"$lysqldizhi"\033[0m"
echo
read -p "请设置数据库密码(默认随机): " lysqlpass
if [ -z "$lysqlpass" ];then
lysqlpass=`date +%s%N | md5sum | head -c 20 ; echo`;
fi
echo -e "已设置数据库密码为:\033[32m "$lysqlpass"\033[0m"
echo
read -p "请设置APP名称(默认:流量卫士): " llwsname
if [ -z "$llwsname" ];then
llwsname=流量卫士
fi
echo -e "已设置APP名称密码为:\033[32m "$llwsname"\033[0m"
echo
read -p "请设置APP解析地址(可输入域名或IP,不带http://): " llwsIP
if [ -z "$llwsIP" ];then
llwsIP=`curl -s http://members.3322.org/dyndns/getip`;
fi
echo -e "已设置APP解析地址为:\033[32m "$llwsIP"\033[0m"
echo
read -p "请设置APP包名(默认:net.dingd.vpn): " llwsbaoming
if [ -z "$llwsbaoming" ];then
llwsbaoming=net.dingd.vpn
fi
echo -e "已设置APP包名为:\033[32m "$llwsbaoming"\033[0m"
sleep 1
echo
echo "请稍等..."
sleep 2
echo
fashoutaijiance
sleep 1
echo -e "\033[1;5;31m所有信息已收集完成!即将为您安装FAS系统!\033[0m"
sleep 3
clear
sleep 1
echo -e "\033[1;32m安装开始...\033[0m"
sleep 5
}
function infodongyun() {
clear
echo
read -p "请输入您的后台端口(默认1024): " Apacheport
if [ -z "$Apacheport" ];then
Apacheport=1024
fi
echo -e "您已输入的后台端口为:\033[32m "$Apacheport"\033[0m"
sleep 2
clear
sleep 1
printf "\n[\033[34m 1/1 \033[0m] 正在重置防火墙并关闭SELinux....\n";
sleep 5
}
function fuzaiji() {
sleep 1
echo "请稍等,正在为您关闭负载机扫描..."
sleep 3
if [ ! -f /bin/jk.sh ]; then
echo
echo "警告!负载机扫描关闭失败!请确认您是否已经关闭过或还未搭建筑梦FAS系统!"
exit;0
fi
rm -rf /bin/jk.sh
vpn restart
echo "负载机扫描关闭成功!感谢您的使用,再见!"
}
function mysqlstop() {
sleep 1
echo "请稍等,正在为您关闭负载机数据库服务..."
sleep 3
service mariadb stop >/dev/null 2>&1
if [[ $? -eq 0 ]];then
echo "MariaDB关闭成功!感谢您的使用,再见!" >/dev/null 2>&1
else
echo "警告!MariaDB关闭失败!请手动关闭MariaDB查看失败原因!脚本停止!"
exit 0
fi
systemctl disable mariadb.service >/dev/null 2>&1
echo
echo "MariaDB关闭成功!感谢您的使用,再见!"
}
#function menu() {
#clear
#echo "请选择yum安装源:"
#echo
#echo "1、中国教育网网络中心安装源(服务器位于北京,北方用户与教育网用户推荐)"
#echo "2、中国科技大学安装源(服务器位于合肥,南方用户推荐)"
#echo "3、搜狐开源镜像安装源(服务器位于山东省联通,全国用户推荐)"
#echo "4、网易开源镜像安装源(全国用户推荐)"
#echo
#read -p " 请输入安装选项并回车: " a
#echo
#k=$a
#CentOS-Base-163.repo, 放入/etc/yum.repos.d/
# if [[ $k == 1 ]];then
# exit;0
# fi
#
# if [[ $k == 2 ]];then
# exit;0
# fi
#
# if [[ $k == 3 ]];then
# exit;0
# fi
#
# if [[ $k == 4 ]];then
# exit;0
# fi
#
# echo -e "\033[31m 输入错误!请重新运行脚本!\033[0m "
# exit;0
#}
function menu() {
clear
echo
echo -e "************************************************"
echo -e " 欢迎使用FAS系统快速安装助手 "
echo -e "************************************************"
echo -e "请选择:"
echo
echo -e "\033[31m 1、安装FAS系统 ("$banben") ♪~(´ε` ) \033[0m"
echo ""
echo -e "\033[31m 2、安装APP制作环境 (只需安装一次!后续制作无需安装!) ♪~(´ε` ) \033[0m"
echo ""
echo -e "\033[31m 3、制作APP (如您安装过APP环境则直接制作即可!) ♪~(´ε` ) \033[0m"
echo
echo -e "\033[31m 4、FAS系统负载(多台服务器集群负载) ♪~(´ε` ) \033[0m"
echo
echo -e "\033[31m 5、重置防火墙 (解决冬云等服务器安装没网) ♪~(´ε` ) \033[0m"
echo
echo -e "\033[31m 6、关闭数据库服务(负载副机关闭即可) ♪~(´ε` ) \033[0m"
echo
echo -e "\033[31m 7、关闭负载机的扫描(关闭后可节省资源) ♪~(´ε` ) \033[0m"
echo
echo -e "\033[31m 8、添加TCP/UDP端口(你们都懂的) ♪~(´ε` ) \033[0m"
echo
echo -e "\033[31m 9、退出脚本! ♪~(´ε` ) \033[0m"
echo
echo
read -p " 请输入安装选项并回车: " a
echo
k=$a
if [[ $k == 1 ]];then
infofas
clear
printf "\n[\033[34m 1/7 \033[0m] 正在安装防火墙并关闭SELinux....\n";
ly01
printf "\n[\033[34m 2/7 \033[0m] 正在安装LAMP环境(耗时较长,耐心等待)....\n";
ly02 >/dev/null 2>&1
printf "\n[\033[34m 3/7 \033[0m] 正在部署流控程序....\n";
ly03
ly04
ly05
ly06
printf "\n[\033[34m 4/7 \033[0m] 正在安装WEB面板....\n";
web
printf "\n[\033[34m 5/7 \033[0m] 正在依赖文件....\n";
sbin
printf "\n[\033[34m 6/7 \033[0m] 正在制作APP....\n";
app
printf "\n[\033[34m 7/7 \033[0m] 正在启动所有服务....\n";
qidongya
done1
exit;0
fi