23 Commits

Author SHA1 Message Date
juewuy
92562f077d 更新 ai.list 2024-03-18 10:39:04 +08:00
juewuy
9688585d66 Merge branch 'dev' of https://github.com/juewuy/ShellCrash into dev
# Conflicts:
#	bin/version
2024-03-17 15:14:37 +08:00
juewuy
9933bbd274 v1.9.1alpha9
~自定义providers功能增加本地模版支持
~增加PushPlus推送
~Pushover推送适配wget命令
~修改小米增强启动的等待方式,优化启动命令
~修复ax7000等设备tproxy模式无法启用的bug
~修复部分设备ipset报错的问题
~修复部分设备ip6tables报错的问题
~尝试修复部分小米设备开机自启失败的问题
~尝试修复部分padavan设备无法正常写入环境变量的问题
2024-03-17 15:13:54 +08:00
Bot
b2fee2d685 自动更新最新Dashboard、地址库、根证书 2024-03-16 18:02:32 +00:00
Bot
5a79bc5258 自动更新最新Dashboard、地址库、根证书 2024-03-15 08:17:12 +00:00
juewuy
8f109ecf2a v1.9.1alpha8
~修复nftables下tproxy本机代理报错的bug
~修复部分情况下tun本机代理失效的问题
~增加自动修改Tproxy混合至Tproxy模式的机制
2024-03-15 16:15:19 +08:00
juewuy
6748da050e v1.9.1alpha7
~修复mac黑名单失效的bug
2024-03-15 10:13:48 +08:00
juewuy
8f0442d2a7 v1.9.1alpha6
~修复cn绕过及ipv6-cn绕过相关bug
2024-03-15 09:51:59 +08:00
juewuy
1e09305e2a v1.9.1alpha5
~修复cn绕过及ipv6-cn绕过相关bug
2024-03-15 09:34:56 +08:00
juewuy
4c78b06a76 修复bug 2024-03-14 11:58:53 +08:00
juewuy
b6a76a5dab v1.9.1alpha4打包 2024-03-11 15:54:32 +08:00
juewuy
33a2ed8a71 ~修复cn绕过未生效的bug
~修复华硕设备ip6tables报错的问题
2024-03-11 15:53:03 +08:00
juewuy
eb025899cd v1.9.1alpha3
~增加主旁转发模式(未妥善测试)
~将DNS进阶设置移动到2-2dns模式设置列表内
~将ipv6进阶设置移动到2-1运行模式设置内
2024-03-09 16:48:29 +08:00
juewuy
66a9ce2215 Merge branch 'dev' into nft-tun
# Conflicts:
#	bin/ShellCrash.tar.gz
#	bin/clashfm.tar.gz
#	bin/public.tar.gz
#	bin/version
#	scripts/init.sh
2024-03-09 12:09:40 +08:00
juewuy
ccf7d9aea4 v1.9.1alpha1打包 2024-03-08 21:35:53 +08:00
juewuy
d76f1823b9 Merge branch 'dev' into nft-tun 2024-03-08 14:25:18 +08:00
juewuy
553a0982e9 ~移除了clash内核及clashpre内核对redir-host模式dns的支持
~增加了为出口流量添加fwmark以防止本机流量回环的机制
~其他简单修复
2024-03-07 17:38:38 +08:00
juewuy
70464412ac getdate.sh > update.sh 2024-03-06 16:04:36 +08:00
juewuy
42475e82fb Merge branch 'dev' into nft-tun 2024-03-06 16:00:19 +08:00
juewuy
1285221f66 重写iptables防火墙
优化nftables防火墙结构
2024-03-05 21:21:40 +08:00
juewuy
1cc516012c ~增加nftables公网访问防火墙
~增加nftables防回环
2024-03-04 12:57:47 +08:00
juewuy
bbe8debe4a Merge branch 'dev' into nft-tun
# Conflicts:
#	scripts/init.sh
2024-03-03 20:37:54 +08:00
juewuy
a2621a01b8 重写nftables防火墙 2024-03-03 19:12:31 +08:00
25 changed files with 49566 additions and 49528 deletions

View File

@@ -113,7 +113,7 @@ jobs:
curl -kfSL -o geodata/srs_geoip_cn.srs https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs curl -kfSL -o geodata/srs_geoip_cn.srs https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs
curl -kfSL -o geodata/srs_geosite_cn.srs https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs curl -kfSL -o geodata/srs_geosite_cn.srs https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs
curl -kfSL -o fix/ca-certificates.crt https://raw.githubusercontent.com/P3TERX/ca-certificates.crt/download/ca-certificates.crt curl -kfSL -o fix/ca-certificates.crt https://raw.githubusercontent.com/P3TERX/ca-certificates.crt/download/ca-certificates.crt
sed -i "s/GeoIP_v=.*/GeoIP_v=$(date '+%Y%m%d)/" version #修改版本号 sed -i "s/GeoIP_v=.*/GeoIP_v=$(date '+%Y%m%d')/" version #修改版本号
echo 数据库及根证书文件更新完成! echo 数据库及根证书文件更新完成!
- name: Commit and push - name: Commit and push

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -40,7 +40,6 @@
5.154.140.0/23 5.154.140.0/23
5.154.158.0/23 5.154.158.0/23
8.21.143.0/24 8.21.143.0/24
8.25.82.0/24
8.38.121.0/24 8.38.121.0/24
8.45.52.0/24 8.45.52.0/24
8.45.176.0/24 8.45.176.0/24
@@ -52,7 +51,6 @@
8.144.0.0/14 8.144.0.0/14
8.148.0.0/19 8.148.0.0/19
8.244.36.0/24 8.244.36.0/24
8.244.68.0/24
14.16.0.0/12 14.16.0.0/12
14.102.156.0/22 14.102.156.0/22
14.103.0.0/18 14.103.0.0/18
@@ -114,7 +112,12 @@
36.112.0.0/15 36.112.0.0/15
36.114.0.0/16 36.114.0.0/16
36.128.0.0/10 36.128.0.0/10
36.192.0.0/11 36.192.0.0/16
36.206.0.0/16
36.212.0.0/17
36.212.128.0/19
36.212.160.0/20
36.212.176.0/21
36.248.0.0/14 36.248.0.0/14
36.255.116.0/22 36.255.116.0/22
36.255.164.0/24 36.255.164.0/24
@@ -125,7 +128,7 @@
38.60.40.0/24 38.60.40.0/24
38.60.45.0/24 38.60.45.0/24
38.60.149.0/24 38.60.149.0/24
38.95.112.0/24 38.95.112.0/22
38.95.232.0/23 38.95.232.0/23
38.102.232.0/22 38.102.232.0/22
38.105.24.0/21 38.105.24.0/21
@@ -246,7 +249,7 @@
43.224.80.0/22 43.224.80.0/22
43.224.148.0/23 43.224.148.0/23
43.224.151.0/24 43.224.151.0/24
43.224.176.0/22 43.224.176.0/23
43.224.208.0/22 43.224.208.0/22
43.225.84.0/23 43.225.84.0/23
43.225.87.0/24 43.225.87.0/24
@@ -346,7 +349,7 @@
43.247.100.0/22 43.247.100.0/22
43.247.176.0/20 43.247.176.0/20
43.247.196.0/22 43.247.196.0/22
43.247.240.0/21 43.247.244.0/22
43.247.248.0/22 43.247.248.0/22
43.248.48.0/22 43.248.48.0/22
43.248.76.0/22 43.248.76.0/22
@@ -364,9 +367,11 @@
43.249.236.0/22 43.249.236.0/22
43.250.4.0/22 43.250.4.0/22
43.250.32.0/22 43.250.32.0/22
43.250.96.0/22
43.250.112.0/22 43.250.112.0/22
43.250.144.0/22 43.250.144.0/22
43.250.168.0/22 43.250.168.0/22
43.250.180.0/23
43.250.200.0/22 43.250.200.0/22
43.250.236.0/22 43.250.236.0/22
43.250.244.0/22 43.250.244.0/22
@@ -389,6 +394,7 @@
43.254.136.0/22 43.254.136.0/22
43.254.140.0/23 43.254.140.0/23
43.254.144.0/20 43.254.144.0/20
43.254.168.0/22
43.254.192.0/22 43.254.192.0/22
43.254.200.0/22 43.254.200.0/22
43.254.220.0/22 43.254.220.0/22
@@ -399,8 +405,6 @@
43.255.68.0/22 43.255.68.0/22
43.255.84.0/22 43.255.84.0/22
43.255.96.0/22 43.255.96.0/22
43.255.116.0/24
43.255.156.0/24
43.255.192.0/22 43.255.192.0/22
43.255.200.0/23 43.255.200.0/23
43.255.202.0/24 43.255.202.0/24
@@ -410,13 +414,12 @@
44.31.28.0/24 44.31.28.0/24
44.31.42.0/23 44.31.42.0/23
44.31.81.0/24 44.31.81.0/24
44.31.96.0/24
44.31.113.0/24 44.31.113.0/24
44.31.165.0/24
44.31.212.0/24 44.31.212.0/24
44.31.216.0/24 44.31.216.0/24
44.31.231.0/24
44.31.234.0/24 44.31.234.0/24
44.159.65.0/24 44.32.69.0/24
44.159.73.0/24 44.159.73.0/24
45.9.11.0/24 45.9.11.0/24
45.12.82.0/24 45.12.82.0/24
@@ -475,7 +478,6 @@
45.146.112.0/23 45.146.112.0/23
45.147.6.0/24 45.147.6.0/24
45.151.47.0/24 45.151.47.0/24
45.151.62.0/24
45.154.104.0/24 45.154.104.0/24
45.157.88.0/24 45.157.88.0/24
45.158.11.0/24 45.158.11.0/24
@@ -520,6 +522,7 @@
45.254.48.0/23 45.254.48.0/23
45.254.50.0/24 45.254.50.0/24
45.254.64.0/20 45.254.64.0/20
45.255.152.0/22
46.8.177.0/24 46.8.177.0/24
46.8.178.0/23 46.8.178.0/23
46.8.180.0/22 46.8.180.0/22
@@ -544,7 +547,7 @@
47.246.10.0/24 47.246.10.0/24
47.246.12.0/23 47.246.12.0/23
47.246.15.0/24 47.246.15.0/24
47.246.16.0/23 47.246.16.0/24
47.246.18.0/24 47.246.18.0/24
47.246.20.0/24 47.246.20.0/24
47.246.22.0/23 47.246.22.0/23
@@ -554,7 +557,7 @@
47.246.36.0/22 47.246.36.0/22
47.246.41.0/24 47.246.41.0/24
47.246.42.0/23 47.246.42.0/23
47.246.44.0/23 47.246.45.0/24
47.246.46.0/24 47.246.46.0/24
47.246.48.0/23 47.246.48.0/23
47.246.50.0/24 47.246.50.0/24
@@ -729,7 +732,7 @@
61.87.192.0/18 61.87.192.0/18
61.128.0.0/10 61.128.0.0/10
61.232.0.0/14 61.232.0.0/14
61.236.0.0/15 61.237.0.0/16
61.240.0.0/16 61.240.0.0/16
61.241.0.0/17 61.241.0.0/17
61.241.128.0/18 61.241.128.0/18
@@ -769,9 +772,8 @@
82.156.0.0/15 82.156.0.0/15
85.237.205.0/24 85.237.205.0/24
87.254.9.0/24 87.254.9.0/24
87.254.18.0/23 87.254.19.0/24
89.116.144.0/24 89.116.144.0/24
89.213.144.0/24
94.191.0.0/17 94.191.0.0/17
101.1.0.0/22 101.1.0.0/22
101.2.172.0/22 101.2.172.0/22
@@ -791,8 +793,9 @@
101.36.64.0/20 101.36.64.0/20
101.36.128.0/17 101.36.128.0/17
101.37.0.0/16 101.37.0.0/16
101.38.0.0/15 101.39.0.0/16
101.40.0.0/14 101.40.0.0/16
101.42.0.0/15
101.49.206.0/23 101.49.206.0/23
101.50.8.0/21 101.50.8.0/21
101.50.56.0/22 101.50.56.0/22
@@ -1088,7 +1091,8 @@
103.69.16.0/22 103.69.16.0/22
103.69.116.0/22 103.69.116.0/22
103.70.220.0/22 103.70.220.0/22
103.71.68.0/22 103.71.69.0/24
103.71.70.0/23
103.71.120.0/21 103.71.120.0/21
103.71.128.0/22 103.71.128.0/22
103.71.196.0/22 103.71.196.0/22
@@ -1194,6 +1198,8 @@
103.103.200.0/22 103.103.200.0/22
103.105.12.0/22 103.105.12.0/22
103.105.60.0/22 103.105.60.0/22
103.105.180.0/22
103.105.184.0/22
103.105.200.0/22 103.105.200.0/22
103.107.188.0/22 103.107.188.0/22
103.107.216.0/22 103.107.216.0/22
@@ -1336,13 +1342,11 @@
103.170.4.0/23 103.170.4.0/23
103.170.212.0/23 103.170.212.0/23
103.172.52.0/24 103.172.52.0/24
103.172.80.0/24
103.172.191.0/24 103.172.191.0/24
103.174.94.0/23 103.174.94.0/23
103.175.197.0/24 103.175.197.0/24
103.177.28.0/23 103.177.28.0/23
103.177.44.0/24 103.177.44.0/24
103.178.56.0/24
103.179.78.0/23 103.179.78.0/23
103.180.108.0/24 103.180.108.0/24
103.181.234.0/24 103.181.234.0/24
@@ -1350,11 +1354,10 @@
103.183.66.0/23 103.183.66.0/23
103.183.122.0/23 103.183.122.0/23
103.183.124.0/23 103.183.124.0/23
103.183.218.0/23 103.183.218.0/24
103.184.44.0/22 103.184.44.0/22
103.186.4.0/23 103.186.4.0/23
103.186.108.0/23 103.186.108.0/23
103.186.159.0/24
103.189.92.0/23 103.189.92.0/23
103.189.140.0/23 103.189.140.0/23
103.189.154.0/23 103.189.154.0/23
@@ -1376,6 +1379,7 @@
103.196.88.0/21 103.196.88.0/21
103.197.0.0/24 103.197.0.0/24
103.197.2.0/23 103.197.2.0/23
103.197.180.0/22
103.197.228.0/22 103.197.228.0/22
103.198.64.0/22 103.198.64.0/22
103.198.124.0/22 103.198.124.0/22
@@ -1404,9 +1408,12 @@
103.205.192.0/22 103.205.192.0/22
103.207.228.0/22 103.207.228.0/22
103.208.12.0/22 103.208.12.0/22
103.208.40.0/24
103.208.42.0/24
103.208.44.0/24
103.208.46.0/24
103.208.48.0/22 103.208.48.0/22
103.209.112.0/22 103.209.112.0/22
103.210.160.0/22
103.210.169.0/24 103.210.169.0/24
103.210.170.0/23 103.210.170.0/23
103.211.44.0/22 103.211.44.0/22
@@ -1425,6 +1432,7 @@
103.215.140.0/22 103.215.140.0/22
103.216.152.0/22 103.216.152.0/22
103.216.252.0/22 103.216.252.0/22
103.218.92.0/22
103.218.216.0/22 103.218.216.0/22
103.219.28.0/22 103.219.28.0/22
103.219.32.0/21 103.219.32.0/21
@@ -1475,7 +1483,6 @@
103.230.212.0/22 103.230.212.0/22
103.230.236.0/22 103.230.236.0/22
103.231.16.0/24 103.231.16.0/24
103.231.56.0/24
103.231.64.0/21 103.231.64.0/21
103.231.144.0/23 103.231.144.0/23
103.231.146.0/24 103.231.146.0/24
@@ -1499,7 +1506,6 @@
103.235.244.0/22 103.235.244.0/22
103.235.248.0/21 103.235.248.0/21
103.236.120.0/22 103.236.120.0/22
103.236.224.0/23
103.236.240.0/20 103.236.240.0/20
103.237.8.0/22 103.237.8.0/22
103.237.28.0/23 103.237.28.0/23
@@ -1562,6 +1568,7 @@
103.249.244.0/22 103.249.244.0/22
103.249.252.0/22 103.249.252.0/22
103.250.32.0/22 103.250.32.0/22
103.250.104.0/22
103.250.192.0/22 103.250.192.0/22
103.250.216.0/22 103.250.216.0/22
103.250.248.0/22 103.250.248.0/22
@@ -1671,16 +1678,12 @@
110.77.0.0/17 110.77.0.0/17
110.80.0.0/13 110.80.0.0/13
110.88.0.0/14 110.88.0.0/14
110.96.0.0/15 110.96.0.0/16
110.98.0.0/16
110.100.0.0/16 110.100.0.0/16
110.112.0.0/15 110.112.0.0/15
110.114.0.0/16 110.114.0.0/16
110.116.0.0/16 110.116.0.0/16
110.118.0.0/16 110.120.0.0/16
110.120.0.0/14
110.124.0.0/15
110.126.0.0/16
110.152.0.0/14 110.152.0.0/14
110.156.0.0/15 110.156.0.0/15
110.166.0.0/15 110.166.0.0/15
@@ -1688,14 +1691,8 @@
110.173.32.0/20 110.173.32.0/20
110.173.192.0/19 110.173.192.0/19
110.176.0.0/12 110.176.0.0/12
110.193.0.0/16
110.194.0.0/15
110.196.0.0/16
110.199.0.0/16 110.199.0.0/16
110.200.0.0/13 110.211.0.0/16
110.208.0.0/14
110.212.0.0/16
110.215.0.0/16
110.218.0.0/16 110.218.0.0/16
110.228.0.0/14 110.228.0.0/14
110.232.32.0/19 110.232.32.0/19
@@ -1711,10 +1708,8 @@
111.120.0.0/14 111.120.0.0/14
111.124.0.0/16 111.124.0.0/16
111.126.0.0/15 111.126.0.0/15
111.128.0.0/12 111.132.0.0/16
111.144.0.0/14
111.148.0.0/16 111.148.0.0/16
111.152.0.0/13
111.160.0.0/13 111.160.0.0/13
111.170.0.0/16 111.170.0.0/16
111.172.0.0/14 111.172.0.0/14
@@ -1723,6 +1718,7 @@
111.192.0.0/12 111.192.0.0/12
111.208.121.0/24 111.208.121.0/24
111.210.0.0/20 111.210.0.0/20
111.210.16.0/24
111.212.0.0/14 111.212.0.0/14
111.221.28.0/24 111.221.28.0/24
111.221.128.0/17 111.221.128.0/17
@@ -1769,8 +1765,7 @@
113.31.96.0/19 113.31.96.0/19
113.31.144.0/20 113.31.144.0/20
113.31.160.0/19 113.31.160.0/19
113.44.0.0/18 113.44.0.0/16
113.44.64.0/19
113.45.128.0/17 113.45.128.0/17
113.48.48.0/20 113.48.48.0/20
113.48.224.0/20 113.48.224.0/20
@@ -1916,12 +1911,9 @@
116.70.64.0/18 116.70.64.0/18
116.76.0.0/15 116.76.0.0/15
116.78.0.0/16 116.78.0.0/16
116.85.0.0/20 116.85.0.0/22
116.85.17.0/24 116.85.14.0/23
116.85.18.0/23 116.85.62.0/24
116.85.20.0/22
116.85.24.0/21
116.85.32.0/19
116.85.64.0/20 116.85.64.0/20
116.85.240.0/20 116.85.240.0/20
116.89.240.0/22 116.89.240.0/22
@@ -1958,7 +1950,6 @@
116.193.18.0/24 116.193.18.0/24
116.196.64.0/18 116.196.64.0/18
116.196.144.0/24 116.196.144.0/24
116.196.148.0/24
116.196.176.0/21 116.196.176.0/21
116.196.192.0/21 116.196.192.0/21
116.196.218.0/23 116.196.218.0/23
@@ -2329,7 +2320,6 @@
120.76.0.0/14 120.76.0.0/14
120.80.0.0/13 120.80.0.0/13
120.88.56.0/23 120.88.56.0/23
120.90.0.0/15
120.92.0.0/17 120.92.0.0/17
120.92.128.0/18 120.92.128.0/18
120.92.192.0/19 120.92.192.0/19
@@ -2419,12 +2409,16 @@
122.49.16.0/20 122.49.16.0/20
122.49.32.0/20 122.49.32.0/20
122.51.0.0/16 122.51.0.0/16
122.64.0.0/12 122.70.0.0/15
122.80.0.0/13 122.72.3.0/24
122.88.0.0/15 122.72.16.0/24
122.72.38.0/24
122.72.61.0/24
122.72.112.0/24
122.84.0.0/16
122.90.0.0/16 122.90.0.0/16
122.91.0.0/17 122.91.0.0/17
122.92.0.0/14 122.94.0.0/16
122.96.0.0/15 122.96.0.0/15
122.102.64.0/20 122.102.64.0/20
122.112.0.0/18 122.112.0.0/18
@@ -2492,11 +2486,10 @@
123.58.224.0/19 123.58.224.0/19
123.59.0.0/16 123.59.0.0/16
123.60.0.0/16 123.60.0.0/16
123.64.0.0/12 123.64.0.0/15
123.80.0.0/13 123.66.0.0/16
123.77.0.0/16
123.88.0.0/16 123.88.0.0/16
123.90.0.0/15
123.92.0.0/14
123.96.0.0/15 123.96.0.0/15
123.99.192.0/18 123.99.192.0/18
123.101.0.0/16 123.101.0.0/16
@@ -2796,7 +2789,8 @@
154.48.236.0/23 154.48.236.0/23
154.48.238.0/24 154.48.238.0/24
154.48.240.0/24 154.48.240.0/24
154.48.244.0/22 154.48.244.0/24
154.48.246.0/23
154.48.248.0/24 154.48.248.0/24
154.48.250.0/23 154.48.250.0/23
154.48.252.0/23 154.48.252.0/23
@@ -2911,7 +2905,6 @@
162.62.168.0/22 162.62.168.0/22
162.62.208.0/20 162.62.208.0/20
162.62.224.0/20 162.62.224.0/20
162.62.255.0/24
162.105.0.0/16 162.105.0.0/16
163.0.0.0/16 163.0.0.0/16
163.5.79.0/24 163.5.79.0/24
@@ -2980,9 +2973,9 @@
163.181.162.0/23 163.181.162.0/23
163.181.164.0/24 163.181.164.0/24
163.181.166.0/23 163.181.166.0/23
163.181.171.0/24
163.181.188.0/24 163.181.188.0/24
163.181.191.0/24 163.181.191.0/24
163.197.63.0/24
163.204.0.0/16 163.204.0.0/16
163.228.0.0/16 163.228.0.0/16
163.244.246.0/24 163.244.246.0/24
@@ -3020,8 +3013,6 @@
175.42.0.0/15 175.42.0.0/15
175.44.0.0/16 175.44.0.0/16
175.46.0.0/15 175.46.0.0/15
175.48.0.0/12
175.64.0.0/11
175.102.0.0/19 175.102.0.0/19
175.102.32.0/22 175.102.32.0/22
175.102.128.0/21 175.102.128.0/21
@@ -3086,7 +3077,7 @@
180.203.0.0/23 180.203.0.0/23
180.203.3.0/24 180.203.3.0/24
180.208.0.0/15 180.208.0.0/15
180.210.212.0/22 180.210.213.0/24
180.212.0.0/15 180.212.0.0/15
180.222.108.0/23 180.222.108.0/23
180.222.110.0/24 180.222.110.0/24
@@ -3105,7 +3096,7 @@
182.50.112.0/20 182.50.112.0/20
182.51.0.0/24 182.51.0.0/24
182.51.123.0/24 182.51.123.0/24
182.51.124.0/23 182.51.124.0/24
182.54.0.0/17 182.54.0.0/17
182.61.0.0/17 182.61.0.0/17
182.61.128.0/18 182.61.128.0/18
@@ -3151,7 +3142,7 @@
185.75.174.0/24 185.75.174.0/24
185.78.106.0/23 185.78.106.0/23
185.216.248.0/22 185.216.248.0/22
185.234.214.0/24 185.234.214.0/23
185.255.152.0/24 185.255.152.0/24
188.131.128.0/17 188.131.128.0/17
191.101.45.0/24 191.101.45.0/24
@@ -3854,7 +3845,8 @@
211.154.0.0/19 211.154.0.0/19
211.154.64.0/18 211.154.64.0/18
211.154.128.0/17 211.154.128.0/17
211.155.0.0/18 211.155.16.0/20
211.155.32.0/19
211.155.80.0/20 211.155.80.0/20
211.155.96.0/19 211.155.96.0/19
211.155.128.0/19 211.155.128.0/19
@@ -4130,6 +4122,7 @@
221.122.0.0/16 221.122.0.0/16
221.123.128.0/17 221.123.128.0/17
221.129.16.0/23 221.129.16.0/23
221.129.23.0/24
221.129.64.0/23 221.129.64.0/23
221.129.72.0/22 221.129.72.0/22
221.129.76.0/23 221.129.76.0/23
@@ -4146,7 +4139,8 @@
221.133.232.0/22 221.133.232.0/22
221.133.240.0/20 221.133.240.0/20
221.137.0.0/16 221.137.0.0/16
221.172.0.0/14 221.172.0.0/16
221.174.0.0/16
221.176.0.0/13 221.176.0.0/13
221.192.0.0/14 221.192.0.0/14
221.196.0.0/15 221.196.0.0/15
@@ -4159,15 +4153,12 @@
221.208.0.0/12 221.208.0.0/12
221.224.0.0/12 221.224.0.0/12
222.16.0.0/12 222.16.0.0/12
222.32.0.0/12 222.35.0.0/16
222.48.0.0/16 222.42.115.0/24
222.44.0.0/15
222.49.128.0/17 222.49.128.0/17
222.50.0.0/15 222.50.0.0/16
222.52.0.0/14
222.56.0.0/15
222.58.0.0/16
222.59.128.0/17 222.59.128.0/17
222.60.0.0/14
222.64.0.0/11 222.64.0.0/11
222.125.0.0/16 222.125.0.0/16
222.126.128.0/22 222.126.128.0/22

View File

@@ -26,10 +26,8 @@
2001:df7:1480::/48 2001:df7:1480::/48
2400:1160::/32 2400:1160::/32
2400:3200::/32 2400:3200::/32
2400:3f60:3::/48
2400:5280:f803::/48 2400:5280:f803::/48
2400:5400:10::/48 2400:5400:10::/48
2400:58a0:1400::/48
2400:58a0:1402::/48 2400:58a0:1402::/48
2400:6000::/32 2400:6000::/32
2400:6460::/40 2400:6460::/40
@@ -122,6 +120,7 @@
2401:13a0:1::/48 2401:13a0:1::/48
2401:1740:2000::/48 2401:1740:2000::/48
2401:1d40::/32 2401:1d40::/32
2401:2780::/32
2401:2e00::/32 2401:2e00::/32
2401:33c0::/32 2401:33c0::/32
2401:3480::/36 2401:3480::/36
@@ -166,8 +165,7 @@
2401:b400::/45 2401:b400::/45
2401:b400:8::/47 2401:b400:8::/47
2401:b400:11::/48 2401:b400:11::/48
2401:b400:14::/48 2401:b400:14::/46
2401:b400:16::/47
2401:b400:20::/47 2401:b400:20::/47
2401:b680::/32 2401:b680::/32
2401:be00::/32 2401:be00::/32
@@ -286,10 +284,14 @@
2404:2280:13c::/47 2404:2280:13c::/47
2404:2280:147::/48 2404:2280:147::/48
2404:2280:193::/48 2404:2280:193::/48
2404:2280:199::/48
2404:2280:19b::/48
2404:2280:19c::/47 2404:2280:19c::/47
2404:2280:19e::/48
2404:2280:1b2::/48 2404:2280:1b2::/48
2404:2280:1b4::/48 2404:2280:1b4::/48
2404:2280:1b8::/48 2404:2280:1b8::/48
2404:2280:1bf::/48
2404:2280:1c1::/48 2404:2280:1c1::/48
2404:2280:1c2::/47 2404:2280:1c2::/47
2404:2280:1c4::/47 2404:2280:1c4::/47
@@ -305,6 +307,8 @@
2404:2280:1e2::/47 2404:2280:1e2::/47
2404:2280:1e4::/47 2404:2280:1e4::/47
2404:2280:1e6::/48 2404:2280:1e6::/48
2404:2280:1e8::/48
2404:2280:1ee::/48
2404:6380::/48 2404:6380::/48
2404:6380:1000::/48 2404:6380:1000::/48
2404:6380:8001::/48 2404:6380:8001::/48
@@ -357,6 +361,7 @@
2405:1480:1000::/48 2405:1480:1000::/48
2405:1480:2000::/48 2405:1480:2000::/48
2405:1480:3000::/47 2405:1480:3000::/47
2405:1640:6::/48
2405:3140:11::/48 2405:3140:11::/48
2405:3140:31::/48 2405:3140:31::/48
2405:3140:3a::/48 2405:3140:3a::/48
@@ -375,6 +380,7 @@
2405:a900:fffe::/48 2405:a900:fffe::/48
2405:ad00::/32 2405:ad00::/32
2405:b7c0::/32 2405:b7c0::/32
2405:be80::/32
2405:d900::/32 2405:d900::/32
2405:e000::/32 2405:e000::/32
2405:f580::/32 2405:f580::/32
@@ -392,7 +398,6 @@
2406:840:100::/48 2406:840:100::/48
2406:840:1c0::/48 2406:840:1c0::/48
2406:840:301::/48 2406:840:301::/48
2406:840:3c1::/48
2406:840:410::/48 2406:840:410::/48
2406:840:800::/42 2406:840:800::/42
2406:840:840::/47 2406:840:840::/47
@@ -405,7 +410,6 @@
2406:840:2800::/48 2406:840:2800::/48
2406:840:3800::/48 2406:840:3800::/48
2406:840:4100::/47 2406:840:4100::/47
2406:840:43c0::/47
2406:840:4800::/47 2406:840:4800::/47
2406:840:4880::/47 2406:840:4880::/47
2406:840:5100::/47 2406:840:5100::/47
@@ -497,12 +501,10 @@
2406:840:fe72::/47 2406:840:fe72::/47
2406:840:fec0::/47 2406:840:fec0::/47
2406:840:fec4::/47 2406:840:fec4::/47
2406:840:fec8::/47 2406:840:fec8::/46
2406:840:feca::/48
2406:840:fed1::/48 2406:840:fed1::/48
2406:840:fed2::/47 2406:840:fed2::/47
2406:840:fed4::/48 2406:840:fed4::/46
2406:840:fed6::/47
2406:840:fed8::/47 2406:840:fed8::/47
2406:840:feda::/48 2406:840:feda::/48
2406:840:fedd::/48 2406:840:fedd::/48
@@ -888,6 +890,7 @@
2408:844b::/32 2408:844b::/32
2408:844c::/30 2408:844c::/30
2408:8452::/31 2408:8452::/31
2408:8454::/32
2408:8456::/31 2408:8456::/31
2408:8458::/30 2408:8458::/30
2408:845c::/31 2408:845c::/31
@@ -949,7 +952,7 @@
2408:8708::/29 2408:8708::/29
2408:8710::/30 2408:8710::/30
2408:8719::/32 2408:8719::/32
2408:871a::/32 2408:871a::/31
2408:8720::/30 2408:8720::/30
2408:8726::/32 2408:8726::/32
2408:872b::/32 2408:872b::/32
@@ -1130,7 +1133,6 @@
240d:c010:58::/48 240d:c010:58::/48
240d:c010:5b::/48 240d:c010:5b::/48
240d:c010:5c::/48 240d:c010:5c::/48
240d:c010:5e::/48
240d:c010:68::/48 240d:c010:68::/48
240d:c010:6c::/48 240d:c010:6c::/48
240d:c040::/44 240d:c040::/44
@@ -1138,7 +1140,6 @@
2602:2a3::/48 2602:2a3::/48
2602:2a4:ff::/48 2602:2a4:ff::/48
2602:2c3:810::/44 2602:2c3:810::/44
2602:f9a9:101::/48
2602:f9df:400::/47 2602:f9df:400::/47
2602:f9df:410::/48 2602:f9df:410::/48
2602:f9df:500::/48 2602:f9df:500::/48
@@ -1229,11 +1230,9 @@
2a05:1085::/32 2a05:1085::/32
2a05:1086:f000::/47 2a05:1086:f000::/47
2a05:1087::/32 2a05:1087::/32
2a05:dfc1:1600::/47 2a05:dfc1:1601::/48
2a05:dfc1:1602::/48 2a05:dfc1:1602::/48
2a05:dfc1:1606::/48
2a05:dfc1:1608::/47 2a05:dfc1:1608::/47
2a05:dfc1:5900::/41
2a05:dfc1:5a00::/40 2a05:dfc1:5a00::/40
2a05:dfc1:6607::/48 2a05:dfc1:6607::/48
2a05:dfc1:7100::/47 2a05:dfc1:7100::/47
@@ -1277,8 +1276,7 @@
2a06:a005:13b0::/44 2a06:a005:13b0::/44
2a06:a005:13c0::/43 2a06:a005:13c0::/43
2a06:a005:13e0::/47 2a06:a005:13e0::/47
2a06:a005:13ea::/47 2a06:a005:13eb::/48
2a06:a005:13ed::/48
2a06:a005:1520::/44 2a06:a005:1520::/44
2a06:a005:1700::/44 2a06:a005:1700::/44
2a06:a005:1800::/48 2a06:a005:1800::/48
@@ -1288,7 +1286,6 @@
2a06:a005:1eee::/48 2a06:a005:1eee::/48
2a06:a005:2040::/44 2a06:a005:2040::/44
2a06:a005:2100::/44 2a06:a005:2100::/44
2a06:a005:2200::/44
2a06:a005:2510::/48 2a06:a005:2510::/48
2a06:a005:28f3::/48 2a06:a005:28f3::/48
2a06:a005:28f4::/48 2a06:a005:28f4::/48
@@ -1299,20 +1296,43 @@
2a06:a005:2940::/43 2a06:a005:2940::/43
2a06:a005:2980::/44 2a06:a005:2980::/44
2a06:a005:29d1::/48 2a06:a005:29d1::/48
2a06:de00:de0e::/47 2a06:de00:de04::/48
2a06:de01:807::/48 2a06:de00:de0e::/48
2a06:de01:87e::/48 2a06:de01:81e::/48
2a06:de01:8b9::/48 2a06:de01:828::/47
2a06:de01:8bb::/48 2a06:de01:834::/48
2a06:de01:8c4::/48 2a06:de01:865::/48
2a06:de01:936::/48 2a06:de01:86a::/48
2a06:de01:93e::/48 2a06:de01:870::/48
2a06:de01:95b::/48 2a06:de01:875::/48
2a06:de01:982::/48 2a06:de01:88b::/48
2a06:de01:ad8::/48 2a06:de01:88c::/48
2a06:de01:ae1::/48 2a06:de01:890::/48
2a06:de01:b1c::/48 2a06:de01:89f::/48
2a06:de01:b1e::/48 2a06:de01:8d7::/48
2a06:de01:8f3::/48
2a06:de01:8f8::/48
2a06:de01:903::/48
2a06:de01:906::/48
2a06:de01:90f::/48
2a06:de01:91a::/48
2a06:de01:91d::/48
2a06:de01:952::/48
2a06:de01:965::/48
2a06:de01:96b::/48
2a06:de01:97c::/48
2a06:de01:990::/48
2a06:de01:998::/48
2a06:de01:99c::/47
2a06:de01:9ad::/48
2a06:de01:ac4::/48
2a06:de01:ad0::/48
2a06:de01:af9::/48
2a06:de01:afc::/48
2a06:de01:b03::/48
2a06:de01:b2f::/48
2a06:de01:b34::/48
2a06:de01:b37::/48
2a06:e881:2509::/48 2a06:e881:2509::/48
2a06:e881:5501::/48 2a06:e881:5501::/48
2a06:e881:5502::/48 2a06:e881:5502::/48
@@ -1329,8 +1349,10 @@
2a0a:6040:e01::/48 2a0a:6040:e01::/48
2a0a:6040:e02::/47 2a0a:6040:e02::/47
2a0a:6040:ea0::/48 2a0a:6040:ea0::/48
2a0a:6040:f00::/48 2a0a:6040:f00::/47
2a0a:6040:f10::/47 2a0a:6040:f02::/48
2a0a:6040:f11::/48
2a0a:6040:f15::/48
2a0a:6040:1b00::/40 2a0a:6040:1b00::/40
2a0a:6040:2222::/48 2a0a:6040:2222::/48
2a0a:6040:2228::/48 2a0a:6040:2228::/48
@@ -1350,7 +1372,7 @@
2a0a:6040:a450::/47 2a0a:6040:a450::/47
2a0a:6040:a730::/48 2a0a:6040:a730::/48
2a0a:6040:a740::/48 2a0a:6040:a740::/48
2a0a:6040:a901::/48 2a0a:6040:a900::/47
2a0a:6040:b770::/44 2a0a:6040:b770::/44
2a0a:6040:c601::/48 2a0a:6040:c601::/48
2a0a:6040:c700::/42 2a0a:6040:c700::/42
@@ -1362,7 +1384,7 @@
2a0a:6040:ce00::/48 2a0a:6040:ce00::/48
2a0a:6040:ce10::/48 2a0a:6040:ce10::/48
2a0a:6040:d0fe::/48 2a0a:6040:d0fe::/48
2a0a:6040:d401::/48 2a0a:6040:d310::/48
2a0a:6040:d600::/44 2a0a:6040:d600::/44
2a0a:6040:d610::/47 2a0a:6040:d610::/47
2a0a:6040:d612::/48 2a0a:6040:d612::/48
@@ -1420,6 +1442,7 @@
2a0d:2581:fffe::/47 2a0d:2581:fffe::/47
2a0d:2683:2::/48 2a0d:2683:2::/48
2a0d:2687::/32 2a0d:2687::/32
2a0d:2904::/44
2a0d:2906:f000::/44 2a0d:2906:f000::/44
2a0d:c7c7::/32 2a0d:c7c7::/32
2a0e:800:ff00::/48 2a0e:800:ff00::/48
@@ -1449,7 +1472,6 @@
2a0e:aa07:e035::/48 2a0e:aa07:e035::/48
2a0e:aa07:e039::/48 2a0e:aa07:e039::/48
2a0e:aa07:e043::/48 2a0e:aa07:e043::/48
2a0e:aa07:e044::/48
2a0e:aa07:e050::/44 2a0e:aa07:e050::/44
2a0e:aa07:e060::/48 2a0e:aa07:e060::/48
2a0e:aa07:e071::/48 2a0e:aa07:e071::/48
@@ -1461,6 +1483,7 @@
2a0e:aa07:e141::/48 2a0e:aa07:e141::/48
2a0e:aa07:e142::/47 2a0e:aa07:e142::/47
2a0e:aa07:e145::/48 2a0e:aa07:e145::/48
2a0e:aa07:e146::/47
2a0e:aa07:e16a::/48 2a0e:aa07:e16a::/48
2a0e:aa07:e200::/44 2a0e:aa07:e200::/44
2a0e:aa07:f000::/48 2a0e:aa07:f000::/48
@@ -1480,7 +1503,6 @@
2a0e:b107:1c0::/48 2a0e:b107:1c0::/48
2a0e:b107:272::/48 2a0e:b107:272::/48
2a0e:b107:790::/44 2a0e:b107:790::/44
2a0e:b107:bd0::/48
2a0e:b107:c10::/48 2a0e:b107:c10::/48
2a0e:b107:da0::/44 2a0e:b107:da0::/44
2a0e:b107:dce::/48 2a0e:b107:dce::/48
@@ -1489,7 +1511,6 @@
2a0e:b107:16c0::/44 2a0e:b107:16c0::/44
2a0e:b107:1a40::/46 2a0e:b107:1a40::/46
2a0e:b107:1b60::/48 2a0e:b107:1b60::/48
2a0e:b107:1b6f::/48
2a0e:b107:1d25::/48 2a0e:b107:1d25::/48
2a0e:b107:1e85::/48 2a0e:b107:1e85::/48
2a0f:1440::/29 2a0f:1440::/29
@@ -1498,8 +1519,10 @@
2a0f:5707:fff5::/48 2a0f:5707:fff5::/48
2a0f:7803:fc00::/44 2a0f:7803:fc00::/44
2a0f:7803:fc30::/44 2a0f:7803:fc30::/44
2a0f:7803:fc80::/44
2a0f:7803:fcc0::/44 2a0f:7803:fcc0::/44
2a0f:7803:fd00::/40 2a0f:7803:fd10::/48
2a0f:7803:fe21::/48
2a0f:7803:fe23::/48 2a0f:7803:fe23::/48
2a0f:7803:fe80::/47 2a0f:7803:fe80::/47
2a0f:7803:fe82::/48 2a0f:7803:fe82::/48
@@ -1509,6 +1532,7 @@
2a0f:85c1:100::/47 2a0f:85c1:100::/47
2a0f:9400:6110::/48 2a0f:9400:6110::/48
2a0f:9400:7700::/48 2a0f:9400:7700::/48
2a0f:9400:800b::/48
2a10:2f00:13a::/48 2a10:2f00:13a::/48
2a10:2f00:147::/48 2a10:2f00:147::/48
2a10:2f00:15a::/48 2a10:2f00:15a::/48
@@ -1548,16 +1572,21 @@
2a13:a5c3:f000::/40 2a13:a5c3:f000::/40
2a13:a5c4:1000::/38 2a13:a5c4:1000::/38
2a13:a5c7:1500::/40 2a13:a5c7:1500::/40
2a13:a5c7:1600::/45 2a13:a5c7:1600::/46
2a13:a5c7:1604::/47
2a13:a5c7:1606::/48
2a13:a5c7:1608::/47 2a13:a5c7:1608::/47
2a13:a5c7:1610::/46 2a13:a5c7:1610::/46
2a13:a5c7:1614::/48
2a13:a5c7:1801::/48 2a13:a5c7:1801::/48
2a13:a5c7:1803::/48 2a13:a5c7:1802::/47
2a13:a5c7:1804::/48
2a13:aac4:f000::/44 2a13:aac4:f000::/44
2a13:b487:11da::/48 2a13:b487:11da::/48
2a13:b487:1200::/43 2a13:b487:1200::/43
2a13:b487:1b86::/48 2a13:b487:1b86::/47
2a13:b487:1bb2::/48 2a13:b487:1bb2::/47
2a13:b487:1bb6::/47
2a13:b487:1bbb::/48 2a13:b487:1bbb::/48
2a13:b487:1f00::/45 2a13:b487:1f00::/45
2a13:b487:4200::/47 2a13:b487:4200::/47

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 KiB

After

Width:  |  Height:  |  Size: 275 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -4,5 +4,5 @@ clash_v=v1.7.1
meta_v=v1.18.1 meta_v=v1.18.1
singboxp_v=1.8.5-73d97226 singboxp_v=1.8.5-73d97226
singbox_v=1.8.8 singbox_v=1.8.8
versionsh=1.9.0release versionsh=1.9.1alpha9
GeoIP_v=20240302 GeoIP_v=20240316

View File

@@ -1,5 +1,4 @@
DOMAIN-SUFFIX,openai.com DOMAIN-KEYWORD,openai
DOMAIN-SUFFIX,openai.nooc.ink
DOMAIN-SUFFIX,AI.com DOMAIN-SUFFIX,AI.com
DOMAIN-SUFFIX,cdn.auth0.com DOMAIN-SUFFIX,cdn.auth0.com
DOMAIN-SUFFIX,openaiapi-site.azureedge.net DOMAIN-SUFFIX,openaiapi-site.azureedge.net

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# Copyright (C) Juewuy # Copyright (C) Juewuy
version=1.9.0release version=1.9.1alpha9
setdir(){ setdir(){
dir_avail(){ dir_avail(){
@@ -201,6 +201,12 @@ else
COMMAND='"$TMPDIR/CrashCore -d $BINDIR -f $TMPDIR/config.yaml"' COMMAND='"$TMPDIR/CrashCore -d $BINDIR -f $TMPDIR/config.yaml"'
fi fi
setconfig COMMAND "$COMMAND" ${CRASHDIR}/configs/command.env setconfig COMMAND "$COMMAND" ${CRASHDIR}/configs/command.env
#设置防火墙执行模式
[ -z "$(grep firewall_mod $CRASHDIR/configs/ShellClash.cfg 2>/dev/null)" ] && {
ckcmd iptables && firewall_mod=iptables
nft add table inet shellcrash 2>/dev/null && firewall_mod=nftables
setconfig firewall_mod $firewall_mod
}
#设置更新地址 #设置更新地址
[ -n "$url" ] && setconfig update_url $url [ -n "$url" ] && setconfig update_url $url
#设置环境变量 #设置环境变量
@@ -291,14 +297,13 @@ done
for file in cron task.sh task.list;do for file in cron task.sh task.list;do
mv -f ${CRASHDIR}/$file ${CRASHDIR}/task/$file 2>/dev/null mv -f ${CRASHDIR}/$file ${CRASHDIR}/task/$file 2>/dev/null
done done
chmod 755 ${CRASHDIR}/task/task.sh
#旧版文件清理 #旧版文件清理
userdel shellclash >/dev/null 2>&1 userdel shellclash >/dev/null 2>&1
sed -i '/shellclash/d' /etc/passwd sed -i '/shellclash/d' /etc/passwd
sed -i '/shellclash/d' /etc/group sed -i '/shellclash/d' /etc/group
rm -rf /etc/init.d/clash rm -rf /etc/init.d/clash
[ "$systype" = "mi_snapshot" -a "$CRASHDIR" != '/data/clash' ] && rm -rf /data/clash [ "$systype" = "mi_snapshot" -a "$CRASHDIR" != '/data/clash' ] && rm -rf /data/clash
for file in CrashCore clash.sh shellcrash.rc core.new clashservice log shellcrash.service mark? mark.bak;do for file in CrashCore clash.sh getdate.sh shellcrash.rc core.new clashservice log shellcrash.service mark? mark.bak;do
rm -rf ${CRASHDIR}/$file rm -rf ${CRASHDIR}/$file
done done
#旧版变量改名 #旧版变量改名
@@ -307,5 +312,9 @@ sed -i "s/clash_v/core_v/g" $configpath
sed -i "s/clash.meta/meta/g" $configpath sed -i "s/clash.meta/meta/g" $configpath
sed -i "s/ShellClash/ShellCrash/g" $configpath sed -i "s/ShellClash/ShellCrash/g" $configpath
sed -i "s/cpucore=armv8/cpucore=arm64/g" $configpath sed -i "s/cpucore=armv8/cpucore=arm64/g" $configpath
sed -i "s/redir_mod=Nft基础/redir_mod=Redir模式/g" $configpath
sed -i "s/redir_mod=Nft混合/redir_mod=Tproxy模式/g" $configpath
sed -i "s/redir_mod=Tproxy混合/redir_mod=Tproxy模式/g" $configpath
sed -i "s/redir_mod=纯净模式/firewall_area=4/g" $configpath
echo -e "\033[32m脚本初始化完成,请输入\033[30;47m crash \033[0;33m命令开始使用\033[0m" echo -e "\033[32m脚本初始化完成,请输入\033[30;47m crash \033[0;33m命令开始使用\033[0m"

View File

@@ -34,10 +34,10 @@ ckstatus(){
#服务器缺省地址 #服务器缺省地址
[ -z "$mix_port" ] && mix_port=7890 [ -z "$mix_port" ] && mix_port=7890
[ -z "$redir_port" ] && redir_port=7892 [ -z "$redir_port" ] && redir_port=7892
[ -z "$fwmark" ] && fwmark=$redir_port
[ -z "$db_port" ] && db_port=9999 [ -z "$db_port" ] && db_port=9999
[ -z "$dns_port" ] && dns_port=1053 [ -z "$dns_port" ] && dns_port=1053
[ -z "$multiport" ] && multiport='22,53,80,123,143,194,443,465,587,853,993,995,5222,8080,8443' [ -z "$multiport" ] && multiport='22,53,80,123,143,194,443,465,587,853,993,995,5222,8080,8443'
[ -z "$local_proxy" ] && local_proxy=未开启
[ -z "$redir_mod" ] && redir_mod=纯净模式 [ -z "$redir_mod" ] && redir_mod=纯净模式
#检查mac地址记录 #检查mac地址记录
[ ! -f ${CRASHDIR}/configs/mac ] && touch ${CRASHDIR}/configs/mac [ ! -f ${CRASHDIR}/configs/mac ] && touch ${CRASHDIR}/configs/mac
@@ -84,12 +84,15 @@ ckstatus(){
[ "$day" = "0" ] && day='' || day="$day天" [ "$day" = "0" ] && day='' || day="$day天"
time=`date -u -d @${time} +%H小时%M分%S秒` time=`date -u -d @${time} +%H小时%M分%S秒`
fi fi
elif [ "$firewall_area" = 5 ] && [ -n "$(ip route list table 100)" ];then
run="\033[32m已设置$redir_mod\033[0m"
else else
run="\033[31m没有运行$redir_mod\033[0m" run="\033[31m没有运行$redir_mod\033[0m"
#检测系统端口占用 #检测系统端口占用
checkport checkport
fi fi
[ "$crashcore" = singbox -o "$crashcore" = singboxp ] && corename=SingBox || corename=Clash [ "$crashcore" = singbox -o "$crashcore" = singboxp ] && corename=SingBox || corename=Clash
[ "$firewall_area" = 5 ] && corename='转发'
[ -f ${TMPDIR}/debug.log -o -f ${CRASHDIR}/debug.log -a -n "$PID" ] && auto="\033[33m并处于debug状态\033[0m" [ -f ${TMPDIR}/debug.log -o -f ${CRASHDIR}/debug.log -a -n "$PID" ] && auto="\033[33m并处于debug状态\033[0m"
#输出状态 #输出状态
echo ----------------------------------------------- echo -----------------------------------------------
@@ -103,7 +106,7 @@ ckstatus(){
#检查新手引导 #检查新手引导
if [ -z "$userguide" ];then if [ -z "$userguide" ];then
setconfig userguide 1 setconfig userguide 1
source ${CRASHDIR}/getdate.sh && userguide source ${CRASHDIR}/update.sh && userguide
fi fi
#检查执行权限 #检查执行权限
[ ! -x ${CRASHDIR}/start.sh ] && chmod +x ${CRASHDIR}/start.sh [ ! -x ${CRASHDIR}/start.sh ] && chmod +x ${CRASHDIR}/start.sh
@@ -118,7 +121,7 @@ ckstatus(){
core_v=$($file -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //') core_v=$($file -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //')
[ -z "$core_v" ] && core_v=$($file version 2>/dev/null | grep -Eo 'version .*' | sed 's/version //') [ -z "$core_v" ] && core_v=$($file version 2>/dev/null | grep -Eo 'version .*' | sed 's/version //')
if [ -n "$core_v" ];then if [ -n "$core_v" ];then
source ${CRASHDIR}/getdate.sh && setcoretype && \ source ${CRASHDIR}/update.sh && setcoretype && \
mv -f $file ${TMPDIR}/CrashCore && \ mv -f $file ${TMPDIR}/CrashCore && \
tar -zcf ${BINDIR}/CrashCore.tar.gz ${tar_para} -C ${TMPDIR} CrashCore && \ tar -zcf ${BINDIR}/CrashCore.tar.gz ${tar_para} -C ${TMPDIR} CrashCore && \
echo -e "\033[32m内核加载完成\033[0m " && \ echo -e "\033[32m内核加载完成\033[0m " && \
@@ -184,7 +187,7 @@ start_core(){
echo -e "\033[33m没有找到${crashcore}配置文件尝试生成providers配置文件\033[0m" echo -e "\033[33m没有找到${crashcore}配置文件尝试生成providers配置文件\033[0m"
[ "$crashcore" = singboxp ] && coretype=singbox [ "$crashcore" = singboxp ] && coretype=singbox
[ "$crashcore" = meta -o "$crashcore" = clashpre ] && coretype=clash [ "$crashcore" = meta -o "$crashcore" = clashpre ] && coretype=clash
source ${CRASHDIR}/getdate.sh && gen_${coretype}_providers source ${CRASHDIR}/update.sh && gen_${coretype}_providers
elif [ -s $core_config -o -n "$Url" -o -n "$Https" ];then elif [ -s $core_config -o -n "$Url" -o -n "$Https" ];then
${CRASHDIR}/start.sh start ${CRASHDIR}/start.sh start
#设置循环检测以判定服务启动是否成功 #设置循环检测以判定服务启动是否成功
@@ -201,7 +204,15 @@ start_core(){
[ -n "$test" -o -n "$(pidof CrashCore)" ] && startover [ -n "$test" -o -n "$(pidof CrashCore)" ] && startover
else else
echo -e "\033[31m没有找到${crashcore}配置文件,请先导入配置文件!\033[0m" echo -e "\033[31m没有找到${crashcore}配置文件,请先导入配置文件!\033[0m"
source ${CRASHDIR}/getdate.sh && set_core_config source ${CRASHDIR}/update.sh && set_core_config
fi
}
start_service(){
if [ "$firewall_area" = 5 ];then
${CRASHDIR}/start.sh start
echo -e "\033[32m已完成防火墙设置\033[0m"
else
start_core
fi fi
} }
checkrestart(){ checkrestart(){
@@ -209,7 +220,7 @@ checkrestart(){
echo -e "\033[32m检测到已变更的内容请重启服务\033[0m" echo -e "\033[32m检测到已变更的内容请重启服务\033[0m"
echo ----------------------------------------------- echo -----------------------------------------------
read -p "是否现在重启服务?(1/0) > " res read -p "是否现在重启服务?(1/0) > " res
[ "$res" = 1 ] && start_core [ "$res" = 1 ] && start_service
} }
#功能相关 #功能相关
log_pusher(){ #日志菜单 log_pusher(){ #日志菜单
@@ -217,6 +228,7 @@ log_pusher(){ #日志菜单
[ -n "$push_Deer" ] && stat_Deer=32m已启用 || stat_Deer=33m未启用 [ -n "$push_Deer" ] && stat_Deer=32m已启用 || stat_Deer=33m未启用
[ -n "$push_bark" ] && stat_bark=32m已启用 || stat_bark=33m未启用 [ -n "$push_bark" ] && stat_bark=32m已启用 || stat_bark=33m未启用
[ -n "$push_Po" ] && stat_Po=32m已启用 || stat_Po=33m未启用 [ -n "$push_Po" ] && stat_Po=32m已启用 || stat_Po=33m未启用
[ -n "$push_PP" ] && stat_PP=32m已启用 || stat_PP=33m未启用
[ "$task_push" = 1 ] && stat_task=32m已启用 || stat_task=33m未启用 [ "$task_push" = 1 ] && stat_task=32m已启用 || stat_task=33m未启用
[ -n "$device_name" ] && device_s=32m$device_name || device_s=33m未设置 [ -n "$device_name" ] && device_s=32m$device_name || device_s=33m未设置
echo ----------------------------------------------- echo -----------------------------------------------
@@ -225,7 +237,8 @@ log_pusher(){ #日志菜单
echo -e " 3 PushDeer推送 ——\033[$stat_Deer\033[0m" echo -e " 3 PushDeer推送 ——\033[$stat_Deer\033[0m"
echo -e " 4 Bark推送-IOS ——\033[$stat_bark\033[0m" echo -e " 4 Bark推送-IOS ——\033[$stat_bark\033[0m"
echo -e " 5 Passover推送 ——\033[$stat_Po\033[0m" echo -e " 5 Passover推送 ——\033[$stat_Po\033[0m"
echo -e " 6 推送任务日志 ——\033[$stat_task\033[0m" echo -e " 6 PushPlus推送 ——\033[$stat_PP\033[0m"
echo -e " 7 推送任务日志 ——\033[$stat_task\033[0m"
echo -e " 8 设置设备名称 ——\033[$device_s\033[0m" echo -e " 8 设置设备名称 ——\033[$device_s\033[0m"
echo -e " 9 清空日志文件" echo -e " 9 清空日志文件"
echo ----------------------------------------------- echo -----------------------------------------------
@@ -355,7 +368,7 @@ log_pusher(){ #日志菜单
setconfig push_Po setconfig push_Po
setconfig push_Po_key setconfig push_Po_key
} }
elif curl --version >/dev/null 2>&1;then else
#echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m" #echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m"
echo -e "请先通过 \033[32;4mhttps://pushover.net/\033[0m 注册账号并获取\033[36mUser Key\033[0m" echo -e "请先通过 \033[32;4mhttps://pushover.net/\033[0m 注册账号并获取\033[36mUser Key\033[0m"
echo ----------------------------------------------- echo -----------------------------------------------
@@ -380,13 +393,35 @@ log_pusher(){ #日志菜单
else else
echo -e "\033[31m输入错误请重新输入\033[0m" echo -e "\033[31m输入错误请重新输入\033[0m"
fi fi
else
echo -e "\033[33mPashover不支持使用wget命令推送请尝试其他推送方式\033[0m"
fi fi
sleep 1 sleep 1
log_pusher log_pusher
;; ;;
6) 6)
echo -----------------------------------------------
if [ -n "$push_PP" ];then
read -p "确认关闭PushPlus日志推送(1/0) > " res
[ "$res" = 1 ] && {
push_PP=
setconfig push_PP
}
else
#echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m"
echo -e "请先通过 \033[32;4mhttps://www.pushplus.plus/push1.html\033[0m 注册账号并获取\033[36mtoken\033[0m"
echo -----------------------------------------------
read -p "请输入你的token > " Token
if [ -n "$Token" ];then
push_PP=$Token
setconfig push_PP $Token
${CRASHDIR}/start.sh logger "已完成PushPlus日志推送设置" 32
else
echo -e "\033[31m输入错误请重新输入\033[0m"
fi
fi
sleep 1
log_pusher
;;
7)
[ "$task_push" = 1 ] && task_push='' || task_push=1 [ "$task_push" = 1 ] && task_push='' || task_push=1
setconfig task_push $task_push setconfig task_push $task_push
sleep 1 sleep 1
@@ -643,29 +678,19 @@ setdns(){ #DNS设置
fi fi
} }
setipv6(){ #ipv6设置 setipv6(){ #ipv6设置
[ -z "$ipv6_support" ] && ipv6_support=已开启
[ -z "$ipv6_redir" ] && ipv6_redir=未开启 [ -z "$ipv6_redir" ] && ipv6_redir=未开启
[ -z "$ipv6_dns" ] && ipv6_dns=已开启 [ -z "$ipv6_dns" ] && ipv6_dns=已开启
[ -z "$cn_ipv6_route" ] && cn_ipv6_route=未开启 [ -z "$cn_ipv6_route" ] && cn_ipv6_route=未开启
echo ----------------------------------------------- echo -----------------------------------------------
[ "$disoverride" != "1" ] && echo -e " 1 ipv6内核支持: \033[36m$ipv6_support\033[0m ——用于ipv6节点及规则支持" echo -e " 1 ipv6透明代理: \033[36m$ipv6_redir\033[0m ——代理ipv6流量"
echo -e " 2 ipv6透明代理: \033[36m$ipv6_redir\033[0m ——代理ipv6流量" [ "$disoverride" != "1" ] && echo -e " 2 ipv6-DNS解析: \033[36m$ipv6_dns\033[0m ——决定内置DNS是否返回ipv6地址"
[ "$disoverride" != "1" ] && echo -e " 3 ipv6-DNS解析: \033[36m$ipv6_dns\033[0m ——决定内置DNS是否返回ipv6地址" echo -e " 3 CNV6绕过内核: \033[36m$cn_ipv6_route\033[0m ——优化性能不兼容fake-ip"
echo -e " 4 CNIP绕过内核: \033[36m$cn_ipv6_route\033[0m ——优化性能不兼容fake-ip"
echo -e " 0 返回上级菜单" echo -e " 0 返回上级菜单"
echo ----------------------------------------------- echo -----------------------------------------------
read -p "请输入对应数字 > " num read -p "请输入对应数字 > " num
case $num in case $num in
1) 1)
[ "$ipv6_support" = "未开启" ] && ipv6_support=已开启 || ipv6_support=未开启
setconfig ipv6_support $ipv6_support
setipv6
;;
2)
if [ "$ipv6_redir" = "未开启" ]; then if [ "$ipv6_redir" = "未开启" ]; then
echo -e "如果启用后导致部分应用加载缓慢,请关闭此功能即可恢复"
echo -e "\033[31m除非特殊需要否则无需开启此功能\033[0m"
ipv6_support=已开启 ipv6_support=已开启
ipv6_redir=已开启 ipv6_redir=已开启
sleep 2 sleep 2
@@ -676,23 +701,23 @@ setipv6(){ #ipv6设置
setconfig ipv6_support $ipv6_support setconfig ipv6_support $ipv6_support
setipv6 setipv6
;; ;;
3) 2)
[ "$ipv6_dns" = "未开启" ] && ipv6_dns=已开启 || ipv6_dns=未开启 [ "$ipv6_dns" = "未开启" ] && ipv6_dns=已开启 || ipv6_dns=未开启
setconfig ipv6_dns $ipv6_dns setconfig ipv6_dns $ipv6_dns
setipv6 setipv6
;; ;;
4) 3)
if [ "$ipv6_redir" = "未开启" ]; then if [ "$ipv6_redir" = "未开启" ]; then
ipv6_support=已开启 ipv6_support=已开启
ipv6_redir=已开启 ipv6_redir=已开启
setconfig ipv6_redir $ipv6_redir setconfig ipv6_redir $ipv6_redir
setconfig ipv6_support $ipv6_support setconfig ipv6_support $ipv6_support
fi fi
if [ -n "$(ipset -v 2>/dev/null)" -o -n "$(echo $redir_mod | grep Nft)" ];then if [ -n "$(ipset -v 2>/dev/null)" ] || [ "$firewall_mod" = nftables ];then
[ "$cn_ipv6_route" = "未开启" ] && cn_ipv6_route=已开启 || cn_ipv6_route=未开启 [ "$cn_ipv6_route" = "未开启" ] && cn_ipv6_route=已开启 || cn_ipv6_route=未开启
setconfig cn_ipv6_route $cn_ipv6_route setconfig cn_ipv6_route $cn_ipv6_route
else else
echo -e "\033[31m当前设备缺少ipset模块或未使用Nft模式,无法启用绕过功能!!\033[0m" echo -e "\033[31m当前设备缺少ipset模块或防火墙未使用nftables,无法启用绕过功能!!\033[0m"
sleep 1 sleep 1
fi fi
setipv6 setipv6
@@ -923,51 +948,6 @@ macfilter(){ #局域网设备过滤
macfilter macfilter
fi fi
} }
localproxy(){ #本机代理
[ -w /etc/systemd/system/shellcrash.service -o -w /usr/lib/systemd/system/shellcrash.service -o -x /bin/su ] && local_enh=1
[ -f /etc/rc.common -a "$(cat /proc/1/comm)" = "procd" ] && [ -w /etc/passwd ] && local_enh=1
echo -----------------------------------------------
echo -e "\033[31m注意:\033[0m如果你不了解Linux系统的流量机制及$crashcore内核的流量劫持机制"
echo -e "启用此功能将可能导致\033[31m流量回环乃至设备死机\033[0m等严重问题"
echo -e "\033[33m如你使用了第三方DNS如smartdns等请务必禁用此功能或者使用shellcrash用户执行\033[0m"
sleep 1
[ -n "$local_enh" ] && {
ckcmd iptables && [ -n "$(iptables -m owner --help | grep owner)" ] && echo -e " 1 使用\033[32miptables增强模式\033[0m配置(支持docker,推荐!)"
nft add table inet shellcrash 2>/dev/null && echo -e " 2 使用\033[32mnftables增强模式\033[0m配置(支持docker,推荐!)"
}
echo -e " 3 使用\033[33m环境变量\033[0m方式配置(部分应用可能无法使用,不推荐!)"
echo -e " 0 返回上级菜单"
echo -----------------------------------------------
read -p "请选择本机代理方式 > " num
case "$num" in
1)
local_type="iptables增强模式"
local_proxy=已开启
;;
2)
local_type="nftables增强模式"
local_proxy=已开启
;;
3)
if [ -z "$authentication" -o "$authentication" = "未设置" ];then
local_type="环境变量"
echo -e "\033[33m注意请重启ShellCrash服务后手动输入以下命令使配置生效\033[0m"
echo -e "【\033[32m source /etc/profile > /dev/null \033[0m】"
local_proxy=已开启
else
echo -e "\033[32m检测到您已经设置了Http/Sock5代理密码请先取消密码\033[0m"
setport
localproxy
fi
sleep 1
;;
*)
errornum
;;
esac
setconfig local_proxy $local_proxy
setconfig local_type $local_type
}
setboot(){ #启动相关设置 setboot(){ #启动相关设置
[ -z "$start_old" ] && start_old=未开启 [ -z "$start_old" ] && start_old=未开启
[ -z "$start_delay" -o "$start_delay" = 0 ] && delay=未设置 || delay=${start_delay} [ -z "$start_delay" -o "$start_delay" = 0 ] && delay=未设置 || delay=${start_delay}
@@ -1115,112 +1095,185 @@ setboot(){ #启动相关设置
esac esac
} }
metacfg(){ set_firewall_area(){
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[31m注意\033[0m基于桥接网卡的Docker/虚拟机流量请使用1或3"
echo -e "\033[33m如你使用了第三方DNS如smartdns等请勿启用本机代理或使用shellcrash用户执行\033[0m"
echo -----------------------------------------------
echo -e " 1 \033[32m仅劫持局域网流量\033[0m"
echo -e " 2 \033[36m仅劫持本机流量\033[0m"
echo -e " 3 \033[32m劫持局域网+本机流量\033[0m"
echo -e " 4 不配置流量劫持(纯净模式)\033[0m"
echo -e " 5 \033[33m转发局域网流量到旁路由设备\033[0m"
echo -----------------------------------------------
read -p "请输入对应数字 > " num
case $num in
[1-4])
[ $firewall_area -ge 4 ] && {
redir_mod=Redir模式
setconfig redir_mod $redir_mod
} }
normal_set(){ #基础设置 [ "$num" = 4 ] && {
set_redir_mod(){ redir_mod=纯净模式
setconfig redir_mod $redir_mod
}
firewall_area=$num
setconfig firewall_area $firewall_area
;;
5)
echo -----------------------------------------------
echo -e "\033[31m注意\033[0m此功能存在多种风险如无网络基础请勿尝试"
echo -e "\033[33m说明\033[0m此功能不启动内核仅配置防火墙转发且子设备无需额外设置网关DNS"
echo -e "\033[33m说明\033[0m支持防火墙分流及设备过滤支持部分定时任务但不支持ipv6"
echo -e "\033[31m注意\033[0m如需代理UDP请确保旁路由运行了支持UDP代理的模式"
echo -e "\033[31m注意\033[0m如使用systemd方式启动内核依然会空载运行建议使用保守模式"
echo -----------------------------------------------
read -p "请输入旁路由IPV4地址 > " bypass_host
[ -n "$bypass_host" ] && {
firewall_area=$num
setconfig firewall_area $firewall_area
setconfig bypass_host $bypass_host
redir_mod=TCP旁路转发
setconfig redir_mod $redir_mod
}
;;
*) errornum ;;
esac
sleep 1
}
set_redir_mod(){ #代理模式设置
set_redir_config(){ set_redir_config(){
setconfig redir_mod $redir_mod setconfig redir_mod $redir_mod
setconfig dns_mod $dns_mod setconfig dns_mod $dns_mod
if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ] && [ "$crashcore" = "clash" ];then
rm -rf ${BINDIR}/clash
rm -rf ${CRASHDIR}/clash
setconfig crashcore meta
fi
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[36m已设为 $redir_mod \033[0m" echo -e "\033[36m已设为 $redir_mod \033[0m"
} }
[ -n "$(iptables -j TPROXY 2>&1 | grep 'on-port')" ] && sup_tp=1
[ -n "$(ls /dev/net/tun 2>/dev/null)" ] || ip tuntap >/dev/null 2>&1 && sup_tun=1 [ -n "$(ls /dev/net/tun 2>/dev/null)" ] || ip tuntap >/dev/null 2>&1 && sup_tun=1
nft add table inet shellcrash 2>/dev/null && sup_nft=1 && modprobe nft_tproxy >/dev/null 2>&1 && sup_nft=2 [ -z "$firewall_area" ] && firewall_area=1
firewall_area_dsc=$(echo "仅局域网 仅本机 局域网+本机 纯净模式 主-旁转发($bypass_host)" | cut -d' ' -f$firewall_area)
if [ -n "$firewall_mod" ];then
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "当前代理模式为:\033[47;30m$redir_mod\033[0mShellCrash核心为\033[47;30m $crashcore \033[0m" echo -e "当前代理模式为:\033[47;30m$redir_mod\033[0mShellCrash核心为\033[47;30m $crashcore \033[0m"
echo -e "\033[33m切换模式后需要手动重启服务以生效\033[0m" echo -e "\033[33m切换模式后需要手动重启服务以生效\033[0m"
echo ----------------------------------------------- echo -----------------------------------------------
ckcmd iptables && echo -e " 1 \033[32mRedir模式\033[0m Redir转发TCP不转发UDP" [ $firewall_area -le 3 ] && {
[ -n "$sup_tun" ] && echo -e " 2 \033[36m混合模式\033[0m Redir转发TCPTun转发UDP" echo -e " 1 \033[32mRedir模式\033[0m Redir转发TCP转发UDP"
[ -n "$sup_tun" ] && echo -e " 4 \033[33mTun模式\033[0m 使用Tun转发TCP&UDP(占用高)" echo -e " 2 \033[36m混合模式\033[0m Redir转发TCPTun转发UDP"
[ -n "$sup_tp" ] && echo -e " 5 \033[32mTproxy模式\033[0m 使用Tproxy转发TCP&UDP" echo -e " 3 \033[32mTproxy模式\033[0m Tproxy转发TCP&UDP"
[ -n "$sup_nft" ] && echo -e " 6 \033[36mNft基础\033[0m 使用nftables转发TCP不转发UDP" echo -e " 4 \033[33mTun模式\033[0m Tun转发TCP&UDP(占用高不推荐)"
[ "$sup_nft" = 2 ] && echo -e " 7 \033[32mNft混合\033[0m 使用nft_tproxy转发TCP&UDP" echo -----------------------------------------------
echo -e " 8 \033[36m纯净模式\033[0m 不设置流量转发" }
[ "$firewall_area" = 5 ] && {
echo -e " 5 \033[32mTCP旁路转发\033[0m 仅转发TCP流量至旁路由"
echo -e " 6 \033[36mT&U旁路转发\033[0m 转发TCP&UDP流量至旁路由"
echo -----------------------------------------------
}
echo -e " 7 设置劫持范围:\033[47;30m$firewall_area_dsc\033[0m"
echo -e " 8 切换防火墙应用:\033[47;30m$firewall_mod\033[0m"
echo -e " 9 ipv6设置\033[47;30m$ipv6_redir\033[0m"
echo " 0 返回上级菜单" echo " 0 返回上级菜单"
read -p "请输入对应数字 > " num read -p "请输入对应数字 > " num
if [ -z "$num" ]; then case $num in
errornum 0) ;;
elif [ "$num" = 0 ]; then 1)
i=
elif [ "$num" = 1 ]; then
redir_mod=Redir模式 redir_mod=Redir模式
dns_mod=redir_host
set_redir_config set_redir_config
set_redir_mod
elif [ "$num" = 2 ]; then ;;
[ -n "$sup_tun" ] || { 2)
echo -e "\033[32m设备未检测到Tun内核模块可能无法代理UDP流量\033[0m" if [ -n "$sup_tun" ];then
sleep 1
}
redir_mod=混合模式 redir_mod=混合模式
set_redir_config set_redir_config
elif [ "$num" = 3 ]; then
if [ -f /etc/init.d/qca-nss-ecm -a "$systype" = "mi_snapshot" ] ;then
read -p "当前设备的QOS服务与本模式冲突是否禁用相关功能(1/0) > " res
[ "$res" = '1' ] && ${CRASHDIR}/misnap_init.sh tproxyfix && redir_mod=Tproxy混合
else else
redir_mod=Tproxy混合 echo -e "\033[31m设备未检测到Tun内核模块请尝试其他模式或者安装相关依赖\033[0m"
sleep 1
fi fi
set_redir_mod
;;
3)
if [ "$firewall_mod" = "iptables" ] ;then
if [ -f /etc/init.d/qca-nss-ecm -a "$systype" = "mi_snapshot" ] ;then
read -p "xiaomi设备的QOS服务与本模式冲突是否禁用相关功能(1/0) > " res
[ "$res" = '1' ] && {
${CRASHDIR}/misnap_init.sh tproxyfix
redir_mod=Tproxy模式
set_redir_config set_redir_config
}
elif [ "$num" = 4 ]; then elif [ -n "$(grep -E '^TPROXY$' /proc/net/ip_tables_targets)" ] ;then
redir_mod=Tproxy模式
set_redir_config
else
echo -e "\033[31m设备未检测到iptables-mod-tproxy模块请尝试其他模式或者安装相关依赖\033[0m"
sleep 1
fi
elif [ "$firewall_mod" = "nftables" ] ;then
if modprobe nft_tproxy >/dev/null 2>&1;then
redir_mod=Tproxy模式
set_redir_config
else
echo -e "\033[31m设备未检测到nft_tproxy内核模块请尝试其他模式或者安装相关依赖\033[0m"
sleep 1
fi
fi
set_redir_mod
;;
4)
if [ -n "$sup_tun" ];then
redir_mod=Tun模式 redir_mod=Tun模式
set_redir_config set_redir_config
elif [ "$num" = 5 ]; then
if [ -f /etc/init.d/qca-nss-ecm -a "$systype" = "mi_snapshot" ] ;then
read -p "当前设备的QOS服务与本模式冲突是否禁用相关功能(1/0) > " res
[ "$res" = '1' ] && ${CRASHDIR}/misnap_init.sh tproxyfix && redir_mod=Tproxy模式
else else
redir_mod=Tproxy模式 echo -e "\033[31m设备未检测到Tun内核模块请尝试其他模式或者安装相关依赖\033[0m"
sleep 1
fi fi
set_redir_mod
;;
5)
redir_mod=TCP旁路转发
set_redir_config set_redir_config
set_redir_mod
elif [ "$num" = 6 ]; then ;;
if ckcmd opkg && [ -z "$(opkg list-installed | grep firewall4)" ];then 6)
read -p "检测到缺少firewall4依赖是否自动安装(1/0) > " res redir_mod=T&U旁路转发
[ "$res" = '1' ] && opkg install firewall4 && redir_mod=Nft基础 set_redir_config
set_redir_mod
;;
7)
set_firewall_area
set_redir_mod
;;
8)
if [ "$firewall_mod" = 'iptables' ];then
if nft add table inet shellcrash 2>/dev/null;then
firewall_mod=nftables
redir_mod=Redir模式
setconfig redir_mod $redir_mod
else else
redir_mod=Nft基础 echo -e "\033[31m当前设备未安装nftables或者nftables版本过低(<1.0.2),无法切换!\033[0m"
fi fi
set_redir_config
elif [ "$num" = 7 ]; then
if ckcmd opkg && [ -z "$(opkg list-installed | grep kmod-nft-tproxy)" ];then
read -p "检测到缺少kmod-nft-tproxy依赖是否自动安装(1/0) > " res
[ "$res" = '1' ] && opkg install kmod-nft-tproxy && redir_mod=Nft混合
else else
redir_mod=Nft混合 if ckcmd iptables;then
firewall_mod=iptables
redir_mod=Redir模式
setconfig redir_mod $redir_mod
else
echo -e "\033[31m当前设备未安装iptables,无法切换!\033[0m"
fi fi
set_redir_config fi
sleep 1
elif [ "$num" = 8 ]; then setconfig firewall_mod $firewall_mod
redir_mod=纯净模式 set_redir_mod
set_redir_config ;;
echo ----------------------------------------------- 9)
echo -e "\033[33m当前模式需要手动在设备WiFi或应用中配置HTTP或sock5代理\033[0m" setipv6
echo -e "HTTP/SOCK5代理服务器地址\033[30;47m$host\033[0m;端口均为:\033[30;47m$mix_port\033[0m" set_redir_mod
echo -e "也可以使用更便捷的PAC自动代理PAC代理链接为" ;;
echo -e "\033[30;47m http://$host:$db_port/ui/pac \033[0m" *)
echo -e "PAC的使用教程请参考\033[4;32mhttps://juewuy.github.io/ehRUeewcv\033[0m"
sleep 2
else
errornum errornum
;;
esac
fi fi
} }
set_dns_mod(){ set_dns_mod(){ #DNS设置
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "当前DNS运行模式为\033[47;30m $dns_mod \033[0m" echo -e "当前DNS运行模式为\033[47;30m $dns_mod \033[0m"
echo -e "\033[33m切换模式后需要手动重启服务以生效\033[0m" echo -e "\033[33m切换模式后需要手动重启服务以生效\033[0m"
@@ -1230,28 +1283,28 @@ normal_set(){ #基础设置
if [ "$crashcore" = singbox -o "$crashcore" = singboxp ];then if [ "$crashcore" = singbox -o "$crashcore" = singboxp ];then
echo -e " 3 mix混合模式 \033[32m内部realip外部fakeip\033[0m" echo -e " 3 mix混合模式 \033[32m内部realip外部fakeip\033[0m"
echo -e " 依赖geosite-cn.(db/srs)数据库" echo -e " 依赖geosite-cn.(db/srs)数据库"
else elif [ "$crashcore" = meta ];then
echo -e " 2 redir_host模式\033[32m兼容性更好\033[0m" echo -e " 2 redir_host模式\033[32m兼容性更好\033[0m"
echo -e " 需搭配加密DNS使用" echo -e " 需搭配加密DNS使用"
fi fi
echo -e " 4 \033[36mDNS进阶设置\033[0m"
echo " 0 返回上级菜单" echo " 0 返回上级菜单"
read -p "请输入对应数字 > " num read -p "请输入对应数字 > " num
if [ -z "$num" ]; then case $num in
errornum 0) ;;
elif [ "$num" = 0 ]; then 1)
i=
elif [ "$num" = 1 ]; then
dns_mod=fake-ip dns_mod=fake-ip
setconfig dns_mod $dns_mod setconfig dns_mod $dns_mod
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[36m已设为 $dns_mod 模式!!\033[0m" echo -e "\033[36m已设为 $dns_mod 模式!!\033[0m"
;;
elif [ "$num" = 2 ]; then 2)
dns_mod=redir_host dns_mod=redir_host
setconfig dns_mod $dns_mod setconfig dns_mod $dns_mod
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[36m已设为 $dns_mod 模式!!\033[0m" echo -e "\033[36m已设为 $dns_mod 模式!!\033[0m"
elif [ "$num" = 3 ]; then ;;
3)
if [ "$crashcore" = singbox -o "$crashcore" = singboxp ];then if [ "$crashcore" = singbox -o "$crashcore" = singboxp ];then
dns_mod=mix dns_mod=mix
setconfig dns_mod $dns_mod setconfig dns_mod $dns_mod
@@ -1261,9 +1314,15 @@ normal_set(){ #基础设置
echo -e "\033[31m当前内核不支持的功能\033[0m" echo -e "\033[31m当前内核不支持的功能\033[0m"
sleep 1 sleep 1
fi fi
else ;;
4)
setdns
set_dns_mod
;;
*)
errornum errornum
fi ;;
esac
} }
fake_ip_filter(){ fake_ip_filter(){
echo -e "\033[32m用于解决Fake-ip模式下部分地址或应用无法连接的问题\033[0m" echo -e "\033[32m用于解决Fake-ip模式下部分地址或应用无法连接的问题\033[0m"
@@ -1297,10 +1356,11 @@ normal_set(){ #基础设置
;; ;;
esac esac
} }
normal_set(){ #基础设置
#获取设置默认显示 #获取设置默认显示
[ -z "$skip_cert" ] && skip_cert=已开启 [ -z "$skip_cert" ] && skip_cert=已开启
[ -z "$common_ports" ] && common_ports=已开启 [ -z "$common_ports" ] && common_ports=已开启
[ -z "$dns_mod" ] && dns_mod=redir_host [ -z "$dns_mod" ] && dns_mod=fake-ip
[ -z "$dns_over" ] && dns_over=已开启 [ -z "$dns_over" ] && dns_over=已开启
[ -z "$cn_ip_route" ] && cn_ip_route=未开启 [ -z "$cn_ip_route" ] && cn_ip_route=未开启
[ -z "$local_proxy" ] && local_proxy=未开启 [ -z "$local_proxy" ] && local_proxy=未开启
@@ -1317,7 +1377,6 @@ normal_set(){ #基础设置
} }
echo -e " 4 只代理常用端口: \033[36m$common_ports\033[0m ————用于过滤P2P流量" echo -e " 4 只代理常用端口: \033[36m$common_ports\033[0m ————用于过滤P2P流量"
echo -e " 5 过滤局域网设备: \033[36m$mac_return\033[0m ————使用黑/白名单进行过滤" echo -e " 5 过滤局域网设备: \033[36m$mac_return\033[0m ————使用黑/白名单进行过滤"
echo -e " 6 设置本机代理服务: \033[36m$local_proxy\033[0m ————使本机流量经过ShellCrash内核"
echo -e " 7 屏蔽QUIC流量: \033[36m$quic_rj\033[0m ————优化视频性能" echo -e " 7 屏蔽QUIC流量: \033[36m$quic_rj\033[0m ————优化视频性能"
[ "$disoverride" != "1" ] && { [ "$disoverride" != "1" ] && {
[ "$dns_mod" != "fake-ip" ] && \ [ "$dns_mod" != "fake-ip" ] && \
@@ -1390,18 +1449,6 @@ normal_set(){ #基础设置
fi fi
normal_set normal_set
elif [ "$num" = 6 ]; then
if [ "$local_proxy" = "未开启" ]; then
localproxy
else
local_proxy=未开启
setconfig local_proxy $local_proxy
setconfig local_type
echo -e "\033[33m已经停用本机代理规则,请尽快重启服务!!\033[0m"
fi
sleep 1
normal_set
elif [ "$num" = 7 ]; then elif [ "$num" = 7 ]; then
echo ----------------------------------------------- echo -----------------------------------------------
if [ -n "$(echo "$redir_mod" | grep -oE '混合|Tproxy|Tun')" ];then if [ -n "$(echo "$redir_mod" | grep -oE '混合|Tproxy|Tun')" ];then
@@ -1420,7 +1467,7 @@ normal_set(){ #基础设置
normal_set normal_set
elif [ "$num" = 8 ]; then elif [ "$num" = 8 ]; then
if [ -n "$(ipset -v 2>/dev/null)" -o -n "$(echo $redir_mod | grep Nft)" ];then if [ -n "$(ipset -v 2>/dev/null)" ] || [ "$firewall_mod" = 'nftables' ];then
if [ "$cn_ip_route" = "未开启" ]; then if [ "$cn_ip_route" = "未开启" ]; then
echo -e "\033[32m已开启CN_IP绕过内核功能\033[0m" echo -e "\033[32m已开启CN_IP绕过内核功能\033[0m"
echo -e "\033[31m注意此功能会导致全局模式及一切CN相关规则失效\033[0m" echo -e "\033[31m注意此功能会导致全局模式及一切CN相关规则失效\033[0m"
@@ -1432,7 +1479,7 @@ normal_set(){ #基础设置
fi fi
setconfig cn_ip_route $cn_ip_route setconfig cn_ip_route $cn_ip_route
else else
echo -e "\033[31m当前设备缺少ipset模块或未使用Nft模式无法启用绕过功能\033[0m" echo -e "\033[31m当前设备缺少ipset模块或未使用nftables模式,无法启用绕过功能!!\033[0m"
sleep 1 sleep 1
fi fi
normal_set normal_set
@@ -1460,13 +1507,11 @@ advanced_set(){ #进阶设置
echo -e "\033[30;47m欢迎使用进阶模式菜单\033[0m" echo -e "\033[30;47m欢迎使用进阶模式菜单\033[0m"
echo -e "\033[33m如您并不了解ShellCrash的运行机制请勿更改本页面功能\033[0m" echo -e "\033[33m如您并不了解ShellCrash的运行机制请勿更改本页面功能\033[0m"
echo ----------------------------------------------- echo -----------------------------------------------
[ "$disoverride" != "1" ] && echo -e " 1 ipv6相关"
#echo -e " 2 配置Meta特性" #echo -e " 2 配置Meta特性"
echo -e " 3 配置公网及局域网防火墙" echo -e " 3 配置公网及局域网防火墙"
[ "$disoverride" != "1" ] && { [ "$disoverride" != "1" ] && {
echo -e " 4 启用域名嗅探: \033[36m$sniffer\033[0m ————用于流媒体及防DNS污染" echo -e " 4 启用域名嗅探: \033[36m$sniffer\033[0m ————用于流媒体及防DNS污染"
echo -e " 5 自定义\033[32m端口及秘钥\033[0m" echo -e " 5 自定义\033[32m端口及秘钥\033[0m"
echo -e " 6 配置内置DNS服务 \033[36m$dns_no\033[0m"
} }
echo ----------------------------------------------- echo -----------------------------------------------
echo -e " 9 \033[31m重置/备份/还原\033[0m脚本设置" echo -e " 9 \033[31m重置/备份/还原\033[0m脚本设置"
@@ -1474,10 +1519,6 @@ advanced_set(){ #进阶设置
echo ----------------------------------------------- echo -----------------------------------------------
read -p "请输入对应数字 > " num read -p "请输入对应数字 > " num
case "$num" in case "$num" in
1)
setipv6
advanced_set
;;
3) 3)
setfirewall setfirewall
advanced_set advanced_set
@@ -1518,10 +1559,6 @@ advanced_set(){ #进阶设置
fi fi
advanced_set advanced_set
;; ;;
6)
setdns
advanced_set
;;
9) 9)
echo -e " 1 备份脚本设置" echo -e " 1 备份脚本设置"
echo -e " 2 还原脚本设置" echo -e " 2 还原脚本设置"
@@ -1722,10 +1759,10 @@ tools(){
i= i=
elif [ "$num" = 1 ]; then elif [ "$num" = 1 ]; then
source ${CRASHDIR}/getdate.sh && testcommand source ${CRASHDIR}/update.sh && testcommand
elif [ "$num" = 2 ]; then elif [ "$num" = 2 ]; then
source ${CRASHDIR}/getdate.sh && userguide source ${CRASHDIR}/update.sh && userguide
elif [ "$num" = 3 ]; then elif [ "$num" = 3 ]; then
log_pusher log_pusher
@@ -1833,7 +1870,7 @@ main_menu(){
exit; exit;
elif [ "$num" = 1 ]; then elif [ "$num" = 1 ]; then
start_core start_service
exit; exit;
elif [ "$num" = 2 ]; then elif [ "$num" = 2 ]; then
@@ -1861,7 +1898,7 @@ main_menu(){
main_menu main_menu
elif [ "$num" = 6 ]; then elif [ "$num" = 6 ]; then
source ${CRASHDIR}/getdate.sh && set_core_config source ${CRASHDIR}/update.sh && set_core_config
main_menu main_menu
elif [ "$num" = 7 ]; then elif [ "$num" = 7 ]; then
@@ -1879,7 +1916,7 @@ main_menu(){
elif [ "$num" = 9 ]; then elif [ "$num" = 9 ]; then
checkcfg=$(cat $CFG_PATH) checkcfg=$(cat $CFG_PATH)
source ${CRASHDIR}/getdate.sh && update source ${CRASHDIR}/update.sh && update
if [ -n "$PID" ];then if [ -n "$PID" ];then
checkcfg_new=$(cat $CFG_PATH) checkcfg_new=$(cat $CFG_PATH)
[ "$checkcfg" != "$checkcfg_new" ] && checkrestart [ "$checkcfg" != "$checkcfg_new" ] && checkrestart

View File

@@ -34,7 +34,7 @@ tunfix(){
mkdir -p /tmp/overlay/work mkdir -p /tmp/overlay/work
mount -o noatime,lowerdir=${ko_dir},upperdir=/tmp/overlay/upper,workdir=/tmp/overlay/work -t overlay "overlay_mods_only" ${ko_dir} mount -o noatime,lowerdir=${ko_dir},upperdir=/tmp/overlay/upper,workdir=/tmp/overlay/work -t overlay "overlay_mods_only" ${ko_dir}
#将tun.ko链接到lib #将tun.ko链接到lib
ln -sf $CRASHDIR/tools/tun.ko ${ko_dir}/tun.ko ln -sf $CRASHDIR/tools/tun.ko ${ko_dir}/tun.ko || $CRASHDIR/start.sh loggger "小米Tun模块修复失败"
} }
tproxyfix(){ tproxyfix(){
sed -i 's/sysctl -w net.bridge.bridge-nf-call-ip/#sysctl -w net.bridge.bridge-nf-call-ip/g' /etc/init.d/qca-nss-ecm sed -i 's/sysctl -w net.bridge.bridge-nf-call-ip/#sysctl -w net.bridge.bridge-nf-call-ip/g' /etc/init.d/qca-nss-ecm
@@ -44,10 +44,8 @@ tproxyfix(){
init(){ init(){
#等待启动完成 #等待启动完成
log_file=$(uci get system.@system[0].log_file) log_file=$(uci get system.@system[0].log_file)
local i=0 while ! /sbin/ip a| grep -q lan; do
while [ "$i" -lt 20 ]; do sleep 10
sleep 3
[ -n "$(grep 'init complete' $log_file)" ] && i=20 || i=$((i + 1))
done done
#初始化环境变量 #初始化环境变量
sed -i "/alias crash/d" $profile sed -i "/alias crash/d" $profile
@@ -68,7 +66,7 @@ init(){
#小米7000/小米万兆修复tproxy #小米7000/小米万兆修复tproxy
[ -f /etc/init.d/qca-nss-ecm ] && [ -n "$(grep 'redir_mod=Tproxy' $CRASHDIR/configs/ShellCrash.cfg )" ] && tproxyfix [ -f /etc/init.d/qca-nss-ecm ] && [ -n "$(grep 'redir_mod=Tproxy' $CRASHDIR/configs/ShellCrash.cfg )" ] && tproxyfix
#启动服务 #启动服务
/etc/init.d/shellcrash start $CRASHDIR/start.sh start
/etc/init.d/shellcrash enable /etc/init.d/shellcrash enable
fi fi
} }

View File

@@ -11,8 +11,11 @@ CRASHDIR=$(cat /etc/profile | grep CRASHDIR | awk -F "\"" '{print $2}')
source ${CRASHDIR}/configs/command.env #加载启动命令和启动目录 source ${CRASHDIR}/configs/command.env #加载启动命令和启动目录
start_service() { start_service() {
if [ -n "$(cat $CRASHDIR/configs/ShellCrash.cfg | grep 'firewall_area=5')" ];then
$CRASHDIR/start.sh start_firewall #主旁转发
else
#本机代理用户 #本机代理用户
[ -n "$(grep -E 'local_type.*增强模式' ${CRASHDIR}/configs/ShellCrash.cfg)" ] && USER=shellcrash || USER=root [ -n "$(grep 'shellcrash:x:0:7890' /etc/passwd)" ] && USER=shellcrash || USER=root
#检测必须文件 #检测必须文件
$CRASHDIR/start.sh bfstart $CRASHDIR/start.sh bfstart
if [ "$?" = "0" ];then if [ "$?" = "0" ];then
@@ -27,6 +30,7 @@ start_service() {
#启动结束执行 #启动结束执行
$CRASHDIR/start.sh afstart & $CRASHDIR/start.sh afstart &
fi fi
fi
} }
stop_service(){ stop_service(){
procd_close_instance procd_close_instance

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
# Copyright (C) Juewuy # Copyright (C) Juewuy
error_down(){ error_down(){
@@ -372,10 +372,12 @@ EOF
provider_temp_file=$(grep "provider_temp_${coretype}" ${CRASHDIR}/configs/ShellCrash.cfg | awk -F '=' '{print $2}') provider_temp_file=$(grep "provider_temp_${coretype}" ${CRASHDIR}/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
fi fi
echo ----------------------------------------------- echo -----------------------------------------------
if [ ! -s ${TMPDIR}/${provider_temp_file} ];then if [ -s ${provider_temp_file} ];then
ln -sf ${provider_temp_file} ${TMPDIR}/provider_temp_file
else
echo -e "\033[33m正在获取在线模版\033[0m" echo -e "\033[33m正在获取在线模版\033[0m"
${CRASHDIR}/start.sh get_bin ${TMPDIR}/${provider_temp_file} rules/${coretype}_providers/${provider_temp_file} ${CRASHDIR}/start.sh get_bin ${TMPDIR}/provider_temp_file rules/${coretype}_providers/${provider_temp_file}
[ -z "$(grep -o 'rules' ${TMPDIR}/${provider_temp_file})" ] && { [ -z "$(grep -o 'rules' ${TMPDIR}/provider_temp_file)" ] && {
echo -e "\033[31m下载失败请尝试更换安装源\033[0m" echo -e "\033[31m下载失败请尝试更换安装源\033[0m"
setserver setserver
setproviders setproviders
@@ -386,9 +388,9 @@ EOF
#预创建文件并写入对应文件头 #预创建文件并写入对应文件头
echo 'proxy-providers:' > ${TMPDIR}/providers/providers.yaml echo 'proxy-providers:' > ${TMPDIR}/providers/providers.yaml
#切割模版文件 #切割模版文件
sed -n '/^proxy-groups:/,/^[a-z]/ { /^rule/d; p; }' ${TMPDIR}/${provider_temp_file} > ${TMPDIR}/providers/proxy-groups.yaml sed -n '/^proxy-groups:/,/^[a-z]/ { /^rule/d; p; }' ${TMPDIR}/provider_temp_file > ${TMPDIR}/providers/proxy-groups.yaml
sed -n '/^rule/,$p' ${TMPDIR}/${provider_temp_file} > ${TMPDIR}/providers/rules.yaml sed -n '/^rule/,$p' ${TMPDIR}/provider_temp_file > ${TMPDIR}/providers/rules.yaml
rm -rf ${TMPDIR}/${provider_temp_file} rm -rf ${TMPDIR}/provider_temp_file
#生成providers模块 #生成providers模块
if [ -n "$2" ];then if [ -n "$2" ];then
gen_clash_providers_txt $1 $2 gen_clash_providers_txt $1 $2
@@ -459,10 +461,12 @@ EOF
provider_temp_file=$(grep "provider_temp_${coretype}" ${CRASHDIR}/configs/ShellCrash.cfg | awk -F '=' '{print $2}') provider_temp_file=$(grep "provider_temp_${coretype}" ${CRASHDIR}/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
fi fi
echo ----------------------------------------------- echo -----------------------------------------------
if [ ! -s ${TMPDIR}/${provider_temp_file} ];then if [ -s ${provider_temp_file} ];then
ln -sf ${provider_temp_file} ${TMPDIR}/provider_temp_file
else
echo -e "\033[33m正在获取在线模版\033[0m" echo -e "\033[33m正在获取在线模版\033[0m"
${CRASHDIR}/start.sh get_bin ${TMPDIR}/${provider_temp_file} rules/${coretype}_providers/${provider_temp_file} ${CRASHDIR}/start.sh get_bin ${TMPDIR}/provider_temp_file rules/${coretype}_providers/${provider_temp_file}
[ -z "$(grep -o 'route' ${TMPDIR}/${provider_temp_file})" ] && { [ -z "$(grep -o 'route' ${TMPDIR}/provider_temp_file)" ] && {
echo -e "\033[31m下载失败请尝试更换安装源\033[0m" echo -e "\033[31m下载失败请尝试更换安装源\033[0m"
setserver setserver
setproviders setproviders
@@ -495,8 +499,8 @@ EOF
fi fi
sed -i '$s/},/}]}/' ${TMPDIR}/providers/providers.json #修复文件格式 sed -i '$s/},/}]}/' ${TMPDIR}/providers/providers.json #修复文件格式
#使用模版生成outbounds和rules模块 #使用模版生成outbounds和rules模块
cat ${TMPDIR}/${provider_temp_file} | sed "s/{providers_tags}/$providers_tags/g" >> ${TMPDIR}/providers/outbounds.json cat ${TMPDIR}/provider_temp_file | sed "s/{providers_tags}/$providers_tags/g" >> ${TMPDIR}/providers/outbounds.json
rm -rf ${TMPDIR}/${provider_temp_file} rm -rf ${TMPDIR}/provider_temp_file
#调用内核测试 #调用内核测试
${CRASHDIR}/start.sh core_check && ${TMPDIR}/CrashCore merge ${TMPDIR}/config.json -C ${TMPDIR}/providers ${CRASHDIR}/start.sh core_check && ${TMPDIR}/CrashCore merge ${TMPDIR}/config.json -C ${TMPDIR}/providers
if [ "$?" = 0 ];then if [ "$?" = 0 ];then
@@ -515,6 +519,14 @@ EOF
fi fi
} }
setproviders(){ #自定义providers setproviders(){ #自定义providers
#获取模版名称
if [ -z "$(grep "provider_temp_${coretype}" ${CRASHDIR}/configs/ShellCrash.cfg)" ];then
provider_temp_des=$(sed -n "1 p" ${CRASHDIR}/configs/${coretype}_providers.list | awk '{print $1}')
else
provider_temp_file=$(grep "provider_temp_${coretype}" ${CRASHDIR}/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
provider_temp_des=$(grep "$provider_temp_file" ${CRASHDIR}/configs/${coretype}_providers.list | awk '{print $1}')
[ -z "$provider_temp_des" ] && provider_temp_des=$provider_temp_file
fi
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[33m你可以在这里快捷管理与生成自定义的providers提供者\033[0m" echo -e "\033[33m你可以在这里快捷管理与生成自定义的providers提供者\033[0m"
echo -e "\033[36m支持在线及本地的Yaml格式配置导入\033[0m" echo -e "\033[36m支持在线及本地的Yaml格式配置导入\033[0m"
@@ -527,7 +539,7 @@ setproviders(){ #自定义providers
echo ----------------------------------------------- echo -----------------------------------------------
echo -e " a \033[36m添加\033[0mproviders提供者" echo -e " a \033[36m添加\033[0mproviders提供者"
echo -e " b \033[32m生成\033[0m基于providers的配置文件" echo -e " b \033[32m生成\033[0m基于providers的配置文件"
echo -e " c 选择\033[33m规则模版\033[0m" echo -e " c 选择\033[33m规则模版\033[0m \033[32m$provider_temp_des\033[0m"
echo -e " d \033[31m清空\033[0mproviders列表" echo -e " d \033[31m清空\033[0mproviders列表"
echo -e " e \033[33m清理\033[0mproviders目录" echo -e " e \033[33m清理\033[0mproviders目录"
echo -e " 0 返回上级菜单" echo -e " 0 返回上级菜单"
@@ -622,25 +634,38 @@ setproviders(){ #自定义providers
setproviders setproviders
;; ;;
c) c)
if [ -z "$(grep "provider_temp_${coretype}" ${CRASHDIR}/configs/ShellCrash.cfg)" ];then
provider_temp_des=$(sed -n "1 p" ${CRASHDIR}/configs/${coretype}_providers.list | awk '{print $1}')
else
provider_temp_file=$(grep "provider_temp_${coretype}" ${CRASHDIR}/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
provider_temp_des=$(grep "$provider_temp_file" ${CRASHDIR}/configs/${coretype}_providers.list | awk '{print $1}')
fi
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "当前规则模版为:\033[32m$provider_temp_des\033[0m" echo -e "当前规则模版为:\033[32m$provider_temp_des\033[0m"
echo -e "\033[33m请选择在线模版\033[0m" echo -e "\033[33m请选择在线模版\033[0m"
echo ----------------------------------------------- echo -----------------------------------------------
cat ${CRASHDIR}/configs/${coretype}_providers.list | awk '{print " "NR" "$1}' cat ${CRASHDIR}/configs/${coretype}_providers.list | awk '{print " "NR" "$1}'
echo ----------------------------------------------- echo -----------------------------------------------
read -p "请输入对应数字 > " num echo -e " a 使用\033[36m本地模版\033[0m"
provider_temp_file=$(sed -n "$num p" ${CRASHDIR}/configs/${coretype}_providers.list | awk '{print $2}') echo -----------------------------------------------
read -p "请输入对应字母或数字 > " num
case $num in
0)
;;
a)
read -p "请输入模版的路径(绝对路径) > " dir
if [ -s $dir ];then
provider_temp_file=$dir
setconfig provider_temp_${coretype} $provider_temp_file
echo -e "\033[32m设置成功\033[0m"
else
echo -e "\033[31m输入错误找不到对应模版文件\033[0m"
fi
sleep 1
;;
*)
provider_temp_file=$(sed -n "$num p" ${CRASHDIR}/configs/${coretype}_providers.list 2>/dev/null | awk '{print $2}')
if [ -z "$provider_temp_file" ];then if [ -z "$provider_temp_file" ];then
errornum errornum
else else
setconfig provider_temp_${coretype} $provider_temp_file setconfig provider_temp_${coretype} $provider_temp_file
fi fi
;;
esac
setproviders setproviders
;; ;;
d) d)
@@ -1104,7 +1129,7 @@ set_core_config(){ #配置文件功能
esac esac
} }
#下载更新相关 #下载更新相关
gettar(){ getscripts(){ #更新脚本文件
${CRASHDIR}/start.sh get_bin ${TMPDIR}/update.tar.gz bin/clashfm.tar.gz ${CRASHDIR}/start.sh get_bin ${TMPDIR}/update.tar.gz bin/clashfm.tar.gz
if [ "$?" != "0" ];then if [ "$?" != "0" ];then
echo -e "\033[33m文件下载失败\033[0m" echo -e "\033[33m文件下载失败\033[0m"
@@ -1127,7 +1152,7 @@ gettar(){
rm -rf ${TMPDIR}/update.tar.gz rm -rf ${TMPDIR}/update.tar.gz
exit exit
} }
getsh(){ setscripts(){
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "当前脚本版本为:\033[33m $versionsh_l \033[0m" echo -e "当前脚本版本为:\033[33m $versionsh_l \033[0m"
echo -e "最新脚本版本为:\033[32m $version_new \033[0m" echo -e "最新脚本版本为:\033[32m $version_new \033[0m"
@@ -1136,7 +1161,7 @@ getsh(){
read -p "是否更新脚本?[1/0] > " res read -p "是否更新脚本?[1/0] > " res
if [ "$res" = '1' ]; then if [ "$res" = '1' ]; then
#下载更新 #下载更新
gettar getscripts
#提示 #提示
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[32m管理脚本更新成功!\033[0m" echo -e "\033[32m管理脚本更新成功!\033[0m"
@@ -1314,7 +1339,7 @@ setcustcore(){ #自定义内核
0) 0)
setcustcore setcustcore
;; ;;
[1-99]) [1-9]|[1-9][0-9])
if [ "$num" -le "$(wc -l < ${TMPDIR}/core.list)" ];then if [ "$num" -le "$(wc -l < ${TMPDIR}/core.list)" ];then
custcorelink=$(sed -n "$num"p ${TMPDIR}/core.list) custcorelink=$(sed -n "$num"p ${TMPDIR}/core.list)
getcore getcore
@@ -1737,7 +1762,7 @@ setgeo(){ #数据库选择菜单
esac esac
} }
getdb(){ getdb(){ #下载Dashboard文件
dblink="${update_url}/" dblink="${update_url}/"
echo ----------------------------------------------- echo -----------------------------------------------
echo 正在连接服务器获取安装文件………… echo 正在连接服务器获取安装文件…………
@@ -1870,7 +1895,7 @@ setdb(){
esac esac
} }
getcrt(){ getcrt(){ #下载根证书文件
echo ----------------------------------------------- echo -----------------------------------------------
echo 正在连接服务器获取安装文件………… echo 正在连接服务器获取安装文件…………
${CRASHDIR}/start.sh get_bin ${TMPDIR}/ca-certificates.crt bin/fix/ca-certificates.crt ${CRASHDIR}/start.sh get_bin ${TMPDIR}/ca-certificates.crt bin/fix/ca-certificates.crt
@@ -2096,7 +2121,7 @@ update(){
elif [ "$num" = 0 ]; then elif [ "$num" = 0 ]; then
i= i=
elif [ "$num" = 1 ]; then elif [ "$num" = 1 ]; then
getsh setscripts
elif [ "$num" = 2 ]; then elif [ "$num" = 2 ]; then
setcore setcore
@@ -2171,10 +2196,6 @@ userguide(){
elif [ "$num" = 1 ];then elif [ "$num" = 1 ];then
#设置运行模式 #设置运行模式
redir_mod="Redir模式" redir_mod="Redir模式"
ckcmd nft && {
redir_mod="Nft基础"
modprobe nft_tproxy >/dev/null 2>&1 && redir_mod="Nft混合"
}
setconfig redir_mod "$redir_mod" setconfig redir_mod "$redir_mod"
#自动识别IPV6 #自动识别IPV6
[ -n "$(ip a 2>&1 | grep -w 'inet6' | grep -E 'global' | sed 's/.*inet6.//g' | sed 's/scope.*$//g')" ] && { [ -n "$(ip a 2>&1 | grep -w 'inet6' | grep -E 'global' | sed 's/.*inet6.//g' | sed 's/scope.*$//g')" ] && {
@@ -2415,35 +2436,44 @@ testcommand(){
exit; exit;
elif [ "$num" = 4 ]; then elif [ "$num" = 4 ]; then
if [ -n "$(echo $redir_mod | grep 'Nft')" -o "$local_type" = "nftables增强模式" ];then if [ "$firewall_mod" = "nftables" ];then
nft list table inet shellcrash nft list table inet shellcrash
else else
echo -------------------Redir--------------------- [ "$firewall_area" = 1 -o "$firewall_area" = 3 -o "$firewall_area" = 5 ] && {
echo ----------------Redir+DNS---------------------
iptables -t nat -L PREROUTING --line-numbers iptables -t nat -L PREROUTING --line-numbers
iptables -t nat -L shellcrash_dns --line-numbers iptables -t nat -L shellcrash_dns --line-numbers
iptables -t nat -L shellcrash --line-numbers [ -n "$(echo $redir_mod | grep -E 'Redir模式|混合模式')" ] && iptables -t nat -L shellcrash --line-numbers
[ -n "$(echo $redir_mod | grep -E 'Tproxy模式|混合模式|Tun模式')" ] && { [ -n "$(echo $redir_mod | grep -E 'Tproxy模式|混合模式|Tun模式')" ] && {
echo ----------------Tun/Tproxy------------------- echo ----------------Tun/Tproxy-------------------
iptables -t mangle -L PREROUTING --line-numbers iptables -t mangle -L PREROUTING --line-numbers
iptables -t mangle -L shellcrash --line-numbers iptables -t mangle -L shellcrash_mark --line-numbers
} }
[ "$local_proxy" = "已开启" ] && [ "$local_type" = "iptables增强模式" ] && { }
echo ----------------OUTPUT------------------- [ "$firewall_area" = 2 -o "$firewall_area" = 3 ] && {
echo -------------OUTPUT-Redir+DNS----------------
iptables -t nat -L OUTPUT --line-numbers iptables -t nat -L OUTPUT --line-numbers
iptables -t nat -L shellcrash_dns_out --line-numbers iptables -t nat -L shellcrash_dns_out --line-numbers
iptables -t nat -L shellcrash_out --line-numbers [ -n "$(echo $redir_mod | grep -E 'Redir模式|混合模式')" ] && iptables -t nat -L shellcrash_out --line-numbers
[ -n "$(echo $redir_mod | grep -E 'Tproxy模式|混合模式|Tun模式')" ] && {
echo ------------OUTPUT-Tun/Tproxy---------------
iptables -t mangle -L OUTPUT --line-numbers
iptables -t mangle -L shellcrash_mark_out --line-numbers
}
} }
[ "$ipv6_redir" = "已开启" ] && { [ "$ipv6_redir" = "已开启" ] && {
[ -n "$(lsmod | grep 'ip6table_nat')" ] && { [ "$firewall_area" = 1 -o "$firewall_area" = 3 ] && {
echo -------------------Redir--------------------- ip6tables -t nat -L >/dev/null 2>&1 && {
echo -------------IPV6-Redir+DNS-------------------
ip6tables -t nat -L PREROUTING --line-numbers ip6tables -t nat -L PREROUTING --line-numbers
ip6tables -t nat -L shellcrashv6_dns --line-numbers ip6tables -t nat -L shellcrashv6_dns --line-numbers
ip6tables -t nat -L shellcrashv6 --line-numbers [ -n "$(echo $redir_mod | grep -E 'Redir模式|混合模式')" ] && ip6tables -t nat -L shellcrashv6 --line-numbers
} }
[ -n "$(echo $redir_mod | grep -E 'Tproxy模式|混合模式|Tun模式')" ] && { [ -n "$(echo $redir_mod | grep -E 'Tproxy模式|混合模式|Tun模式')" ] && {
echo ----------------Tun/Tproxy------------------- echo -------------IPV6-Tun/Tproxy------------------
ip6tables -t mangle -L PREROUTING --line-numbers ip6tables -t mangle -L PREROUTING --line-numbers
ip6tables -t mangle -L shellcrashv6 --line-numbers ip6tables -t mangle -L shellcrashv6_mark --line-numbers
}
} }
} }
fi fi