1
1
#! /usr/bin/env bash
2
2
3
3
# 当前脚本版本号
4
- VERSION=' v1.0'
4
+ VERSION=' v1.0.1 '
5
5
6
6
# 各变量默认值
7
7
GH_PROXY=' https://gh-proxy.com/' # 不稳定,暂不使用
@@ -11,19 +11,19 @@ START_PORT_DEFAULT='8881'
11
11
MIN_PORT=1000
12
12
MAX_PORT=65525
13
13
TLS_SERVER=addons.mozilla.org
14
- CDN_DEFAULT=www.who.int
14
+ CDN_DEFAULT=cn.azhz.eu.org
15
15
PROTOCAL_LIST=(" reality" " hysteria2" " tuic" " shadowTLS" " shadowsocks" " trojan" " vmess + ws" " vless + ws + tls" )
16
16
CONSECUTIVE_PORTS=${# PROTOCAL_LIST[@]}
17
- CDN_DOMAIN=(" www.who.int" " cdn.anycast.eu.org" " 443.cf.bestl.de" " cn.azhz.eu.org " " cfip.gay" )
17
+ CDN_DOMAIN=(" cn.azhz.eu.org " " www.who.int" " cdn.anycast.eu.org" " 443.cf.bestl.de" " cfip.gay" )
18
18
19
19
trap " rm -rf $TEMP_DIR >/dev/null 2>&1 ; echo -e '\n' ;exit 1" INT QUIT TERM EXIT
20
20
21
21
mkdir -p $TEMP_DIR
22
22
23
23
E[0]=" Language:\n 1. English (default) \n 2. 简体中文"
24
24
C[0]=" ${E[0]} "
25
- E[1]=" 1. Sing-box Family bucket v1.0 ; 2. After installing, add [ sb ] shortcut ; 3. Output the configuration for Sing-box Client "
26
- C[1]=" 1. Sing-box 全家桶 v1.0 ; 2. 安装后,增加 [ sb ] 的快捷运行方式 ; 3. 输出 Sing-box Client 的配置 "
25
+ E[1]=" 1. Support TCP brutal. Reinstall is required ; 2. Use alpha verion instead of latest ; 3. Change the default CDN to [ cn.azhz.eu.org ] "
26
+ C[1]=" 1. 支持 TCP brutal,需要重新安装 ; 2. 由于 Sing-box 更新极快,将使用 alpha 版本替代 latest ; 3. 默认优选改为 [ cn.azhz.eu.org ] "
27
27
E[2]=" This project is designed to add sing-box support for multiple protocols to VPS, details: [https://github.com/fscarmen/sing-box]\n Script Features:\n\t • Deploy multiple protocols with one click, there is always one for you!\n\t • Custom ports for nat machine with limited open ports.\n\t • Built-in warp chained proxy to unlock chatGPT.\n\t • No domain name is required.\n\t • Support system: Ubuntu, Debian, CentOS, Alpine and Arch Linux 3.\n\t • Support architecture: AMD,ARM and s390x\n"
28
28
C[2]=" 本项目专为 VPS 添加 sing-box 支持的多种协议, 详细说明: [https://github.com/fscarmen/sing-box]\n 脚本特点:\n\t • 一键部署多协议,总有一款适合你\n\t • 自定义端口,适合有限开放端口的 nat 小鸡\n\t • 内置 warp 链式代理解锁 chatGPT\n\t • 不需要域名\n\t • 智能判断操作系统: Ubuntu 、Debian 、CentOS 、Alpine 和 Arch Linux,请务必选择 LTS 系统\n\t • 支持硬件结构类型: AMD 和 ARM\n"
29
29
E[3]=" Input errors up to 5 times.The script is aborted."
@@ -251,8 +251,8 @@ check_install() {
251
251
STATUS=$( text 26) && [ -s /etc/systemd/system/sing-box.service ] && STATUS=$( text 27) && [ " $( systemctl is-active sing-box) " = ' active' ] && STATUS=$( text 28)
252
252
if [[ $STATUS = " $( text 26) " ]] && [ ! -s $WORK_DIR /sing-box ]; then
253
253
{
254
- local ONLINE=$( wget -qO- " https://api.github.com/repos/SagerNet/sing-box/releases/latest " | grep " tag_name " | sed " s@.* \" v\(.*\) \" ,@\1@g " )
255
- ONLINE=${ONLINE:- ' 1.6.0 ' }
254
+ local ONLINE=$( wget -qO- " https://api.github.com/repos/SagerNet/sing-box/releases" | awk -F ' ["v] ' ' /tag_name.*alpha/{print $5; exit} ' )
255
+ ONLINE=${ONLINE:- ' 1.7.0-alpha.11 ' }
256
256
wget -c ${GH_PROXY} https://github.com/SagerNet/sing-box/releases/download/v$ONLINE /sing-box-$ONLINE -linux-$SING_BOX_ARCH .tar.gz -qO- | tar xz -C $TEMP_DIR sing-box-$ONLINE -linux-$SING_BOX_ARCH /sing-box
257
257
[ -s $TEMP_DIR /sing-box-$ONLINE -linux-$SING_BOX_ARCH /sing-box ] && mv $TEMP_DIR /sing-box-$ONLINE -linux-$SING_BOX_ARCH /sing-box $TEMP_DIR
258
258
}&
635
635
""
636
636
]
637
637
}
638
+ },
639
+ "multiplex":{
640
+ "enabled":true,
641
+ "padding":true,
642
+ "brutal":{
643
+ "enabled":true,
644
+ "up_mbps":1000,
645
+ "down_mbps":1000
646
+ }
638
647
}
639
648
}
640
649
]
703
712
"password":"$UUID "
704
713
}
705
714
],
706
- "congestion_control":"bbr",
715
+ "congestion_control": "bbr",
716
+ "zero_rtt_handshake": false,
707
717
"tls":{
708
718
"enabled":true,
709
719
"alpn":[
751
761
"listen":"127.0.0.1",
752
762
"network":"tcp",
753
763
"method":"2022-blake3-aes-128-gcm",
754
- "password":"$SHADOWTLS_PASSWORD "
764
+ "password":"$SHADOWTLS_PASSWORD ",
765
+ "multiplex":{
766
+ "enabled":true,
767
+ "padding":true,
768
+ "brutal":{
769
+ "enabled":true,
770
+ "up_mbps":1000,
771
+ "down_mbps":1000
772
+ }
773
+ }
755
774
}
756
775
]
757
776
}
773
792
"listen":"::",
774
793
"listen_port":$PORT_SHADOWSOCKS ,
775
794
"method":"aes-128-gcm",
776
- "password":"$UUID "
795
+ "password":"$UUID ",
796
+ "multiplex":{
797
+ "enabled":true,
798
+ "padding":true,
799
+ "brutal":{
800
+ "enabled":true,
801
+ "up_mbps":1000,
802
+ "down_mbps":1000
803
+ }
804
+ }
777
805
}
778
806
]
779
807
}
803
831
"enabled":true,
804
832
"certificate_path":"$WORK_DIR /cert/cert.pem",
805
833
"key_path":"$WORK_DIR /cert/private.key"
834
+ },
835
+ "multiplex":{
836
+ "enabled":true,
837
+ "padding":true,
838
+ "brutal":{
839
+ "enabled":true,
840
+ "up_mbps":1000,
841
+ "down_mbps":1000
842
+ }
806
843
}
807
844
}
808
845
]
837
874
"path":"/${UUID} -vmess",
838
875
"max_early_data":2048,
839
876
"early_data_header_name":"Sec-WebSocket-Protocol"
877
+ },
878
+ "multiplex":{
879
+ "enabled":true,
880
+ "padding":true,
881
+ "brutal":{
882
+ "enabled":true,
883
+ "up_mbps":1000,
884
+ "down_mbps":1000
885
+ }
840
886
}
841
887
}
842
888
]
879
925
"max_version":"1.3",
880
926
"certificate_path":"${WORK_DIR} /cert/cert.pem",
881
927
"key_path":"${WORK_DIR} /cert/private.key"
928
+ },
929
+ "multiplex":{
930
+ "enabled":true,
931
+ "padding":true,
932
+ "brutal":{
933
+ "enabled":true,
934
+ "up_mbps":1000,
935
+ "down_mbps":1000
936
+ }
882
937
}
883
938
}
884
939
]
@@ -1077,7 +1132,13 @@ $(info "$(text 54)
1077
1132
\" method\" :\" 2022-blake3-aes-128-gcm\" ,
1078
1133
\" password\" :\" ${SHADOWTLS_PASSWORD} \" ,
1079
1134
\" type\" :\" shadowsocks\" ,
1080
- \" udp_over_tcp\" :false
1135
+ \" udp_over_tcp\" : false,
1136
+ \" multiplex\" : {
1137
+ \" enabled\" : true,
1138
+ \" protocol\" : \" h2mux\" ,
1139
+ \" max_connections\" : 16,
1140
+ \" padding\" : true
1141
+ }
1081
1142
},
1082
1143
{
1083
1144
\" domain_strategy\" :\"\" ,
@@ -1093,6 +1154,10 @@ $(info "$(text 54)
1093
1154
\" fingerprint\" : \" chrome\"
1094
1155
}
1095
1156
},
1157
+ \" multiplex\" :{
1158
+ \" enabled\" :true,
1159
+ \" padding\" :true
1160
+ },
1096
1161
\" type\" :\" shadowtls\" ,
1097
1162
\" version\" :3
1098
1163
}
@@ -1418,7 +1483,7 @@ $(info " {
1418
1483
\" enabled\" :true,
1419
1484
\" protocol\" :\" h2mux\" ,
1420
1485
\" max_connections\" : 16,
1421
- \" padding\" :true
1486
+ \" padding\" : true
1422
1487
}
1423
1488
}," )
1424
1489
EOF
@@ -1442,7 +1507,7 @@ $(info " {
1442
1507
\" enabled\" :true,
1443
1508
\" protocol\" :\" h2mux\" ,
1444
1509
\" max_streams\" :16,
1445
- \" padding\" :true
1510
+ \" padding\" : true
1446
1511
}
1447
1512
}," )
1448
1513
EOF
@@ -1474,7 +1539,7 @@ $(info " {
1474
1539
\" enabled\" :true,
1475
1540
\" protocol\" :\" h2mux\" ,
1476
1541
\" max_streams\" :16,
1477
- \" padding\" :true
1542
+ \" padding\" : true
1478
1543
}
1479
1544
}," )
1480
1545
EOF
@@ -1726,7 +1791,7 @@ uninstall() {
1726
1791
1727
1792
# Sing-box 的最新版本
1728
1793
version() {
1729
- local ONLINE=$( wget -qO- " https://api.github.com/repos/SagerNet/sing-box/releases/latest " | grep " tag_name " | sed " s@.* \" v\(.*\) \" ,@\1@g " )
1794
+ local ONLINE=$( wget -qO- " https://api.github.com/repos/SagerNet/sing-box/releases" | awk -F ' ["v] ' ' /tag_name.*alpha/{print $5; exit} ' )
1730
1795
local LOCAL=$( $WORK_DIR /sing-box version | awk ' /version/{print $NF}' )
1731
1796
info "\n $( text 40) "
1732
1797
[[ -n "$ONLINE " && "$ONLINE " != "$LOCAL " ]] && reading "\n $( text 9) " UPDATE || info " $( text 41) "
0 commit comments