148 Commits

Author SHA1 Message Date
juewuy
ed635b871a Merge pull request #1229 from DustinWin/dev
删除 games(GEOIP)和 gamesip 规则集
2026-03-04 17:38:31 +08:00
DustinWin
a32b05a391 删除 games(GEOIP)和 gamesip 规则集 2026-03-04 17:27:21 +08:00
juewuy
9e78370c5c Merge pull request #1225 from DustinWin/dev
优化配置文件中的名称,避免歧义
2026-03-03 09:03:50 +08:00
DustinWin
c66c642ca2 优化配置文件中的名称,避免歧义 2026-03-03 01:52:05 +08:00
juewuy
bd9abee53f 更新 core_easy_update.yaml 2026-03-01 08:51:04 +08:00
juewuy
4f9b066015 更新 core_easy_update.yaml 2026-03-01 08:44:09 +08:00
juewuy
2c9eda6cc6 Merge pull request #1219 from DustinWin/dev
优化配置文件
2026-02-25 16:31:31 +08:00
DustinWin
a6cc498cbd Merge branch 'dev' into dev 2026-02-25 15:33:57 +08:00
DustinWin
d032742984 优化配置文件 2026-02-25 15:31:22 +08:00
juewuy
c373b0b7b0 更新 DustinWin_RS_Full_NoAds.yaml 2026-02-20 13:46:26 +08:00
juewuy
31bf9915c6 ~修复小闪存模式部分情况下启动报错的bug 2026-02-15 20:37:11 +08:00
juewuy
cae9613225 Merge branch 'master' into dev 2026-02-14 21:15:57 +08:00
juewuy
02a342cbd1 Merge branch 'master' of https://github.com/juewuy/ShellCrash into master
# Conflicts:
#	scripts/starts/start_legacy_wd.sh
2026-02-14 21:15:43 +08:00
juewuy
1fbade025a ~优化保守模式守护进程 2026-02-14 21:14:13 +08:00
juewuy
65244e51da ~版本回退改为使用api链接 2026-02-14 20:48:52 +08:00
juewuy
1087f57893 Merge branch 'master' into dev 2026-02-14 20:31:11 +08:00
juewuy
f5394120e1 ~优化保守模式守护进程 2026-02-14 20:30:53 +08:00
juewuy
0a52ef2531 cn-lite.mrs>cn.mrs 2026-02-11 18:07:51 +08:00
juewuy
24fc10a59f ~1.9.5a11 pkg 2026-02-10 20:14:26 +08:00
juewuy
5d4fcc2271 ~修复singboxr本地生成失败的bug 2026-02-10 20:09:22 +08:00
juewuy
8083166256 ~fix 2026-02-10 20:05:45 +08:00
juewuy
a15b431e97 Merge branch 'master' into dev
# Conflicts:
#	ShellCrash.tar.gz
#	bin/version
#	version
2026-02-10 20:00:23 +08:00
juewuy
0589bc7881 ~1.9.4rc7.1 pkg 2026-02-10 19:57:07 +08:00
juewuy
3b578c7988 ~修复TG-BOT因守护进程错乱导致的各种bug 2026-02-10 19:56:38 +08:00
juewuy
7f73133657 Merge branch 'master' of https://github.com/juewuy/ShellCrash into master
# Conflicts:
#	ShellCrash.tar.gz
2026-02-10 19:44:36 +08:00
juewuy
952e1a8f63 ~1.9.4rc7 pkg 2026-02-10 19:44:11 +08:00
juewuy
2c6e23e54d Merge branch 'master' into dev
# Conflicts:
#	ShellCrash.tar.gz
#	bin/version
#	version
2026-02-10 19:41:35 +08:00
juewuy
b3ac793f6e ~1.9.4rc7 pkg 2026-02-10 19:34:20 +08:00
juewuy
37269ef851 ~增加每次启动tg_bot服务时自动推送菜单的开关 2026-02-10 19:31:15 +08:00
juewuy
f2ce2fb9b4 ~自定义内核链接支持.upx结尾内核文件 2026-02-10 19:18:12 +08:00
juewuy
d86969bf9b ~修复Mihomo内核自动检测下载geoip和geosite数据库功能未工作的bug 2026-02-10 19:02:54 +08:00
juewuy
cd170e9b27 Merge branch 'dev' of https://github.com/juewuy/ShellCrash into dev
# Conflicts:
#	scripts/libs/web_get.sh
2026-02-08 21:42:33 +08:00
juewuy
1c1d2ddac2 ~1.9.5a10 pkg 2026-02-08 21:41:30 +08:00
juewuy
e5489f3c91 ~修复和优化curl进度条显示功能 2026-02-08 21:38:44 +08:00
juewuy
93ad3c133c ~修复和优化curl进度条显示功能 2026-02-08 21:26:53 +08:00
juewuy
b6bc1e9f72 Merge branch 'master' into dev
# Conflicts:
#	ShellCrash.tar.gz
#	bin/version
#	version
2026-02-08 20:15:15 +08:00
juewuy
dfc6910bc3 ~1.9.4rc6.1 pkg 2026-02-08 20:14:30 +08:00
juewuy
1afb261d0e ~优化定时任务 2026-02-08 20:13:55 +08:00
juewuy
e693b7ad35 已修改 README_CN.md 2026-02-08 19:51:37 +08:00
juewuy
fa72c49f2f Merge branch 'master' into dev
# Conflicts:
#	ShellCrash.tar.gz
#	bin/version
#	version
2026-02-08 19:50:30 +08:00
juewuy
32d73c18c4 ~1.9.4rc6 pkg 2026-02-08 19:38:01 +08:00
juewuy
cb9d5a783b ~修复保守模式部分情况下反复重启的bug 2026-02-08 19:31:23 +08:00
juewuy
c4bdd18195 ~修复ddns工具的一些bug 2026-02-08 19:14:45 +08:00
juewuy
7f0b0fa870 ~bug fix 2026-02-08 18:36:50 +08:00
juewuy
d5d9fab8e0 ~bug fix 2026-02-08 18:28:05 +08:00
juewuy
053f05d394 ~修复docker相关bug 2026-02-08 18:25:47 +08:00
juewuy
fc1c3c4415 ~bug fix 2026-02-08 18:05:01 +08:00
juewuy
623414bfa9 Merge pull request #1212 from Maozai-Teng/dev
一个等号引发的血案
2026-02-06 14:43:46 +08:00
小小小猫仔
09bbe6f402 Fix URLs in ShellCrash_RS_Nano.yaml 2026-02-06 14:19:35 +08:00
小小小猫仔
524c8a4268 Fix URLs in DustinWin_RS_Lite_NoAds.yaml 2026-02-06 14:18:45 +08:00
小小小猫仔
b883e20b3e Fix URLs in DustinWin_RS_Lite.yaml 2026-02-06 14:18:25 +08:00
小小小猫仔
347f4668b4 Fix URLs in DustinWin_RS_Light.yaml 2026-02-06 14:18:07 +08:00
小小小猫仔
5e05fea6f0 Fix URLs in DustinWin_RS_Full_NoAds.yaml 2026-02-06 14:17:45 +08:00
小小小猫仔
77113c81a4 Fix URLs in DustinWin_RS_Full.yaml 2026-02-06 14:17:12 +08:00
小小小猫仔
3f39be82c4 一个等号引发的血案
去掉了那个【=】
2026-02-06 13:28:38 +08:00
juewuy
3aeaec6ae4 Merge pull request #1211 from sofia-riese/chore-1
chore: UI/UX adjustments
2026-02-05 14:22:59 +08:00
sofia-riese
aad43f15b3 chore: UI/UX adjustments 2026-02-05 13:59:05 +08:00
juewuy
1b2521290f ~1.9.5a9 pkg 2026-02-04 19:51:08 +08:00
juewuy
642ac95ae9 ~增加单独查看启动日志的功能 2026-02-04 19:28:15 +08:00
juewuy
2fc3a18df4 ~Change same dns info 2026-02-04 19:18:15 +08:00
juewuy
abb7d462a1 Merge branch 'master' into dev 2026-02-04 19:07:22 +08:00
juewuy
6a1d4086f3 ~1.9.4r5 pkg 2026-02-04 19:05:22 +08:00
juewuy
b59da3be8a ~fix 2026-02-04 18:53:46 +08:00
juewuy
76efd54d03 ~bug fix 2026-02-04 18:52:11 +08:00
juewuy
ace8b08407 ~优化容器部署说明,修复持久化问题 2026-02-04 18:46:25 +08:00
juewuy
f70e642fea ~修复部分情况下自启状态显示不正确的bug 2026-02-04 18:27:29 +08:00
juewuy
614bc696bb ~继续优化定时任务功能 2026-02-04 18:20:43 +08:00
juewuy
cd7d4232b6 ~修复因.start_error失败标记导致的部分bug 2026-02-04 17:59:20 +08:00
juewuy
f8e4450222 Merge pull request #1210 from sofia-riese/chore-3
chore: UI adjustments
2026-02-03 21:36:48 +08:00
sofia-riese
c92355742e chore: UI adjustments 2026-02-03 21:19:07 +08:00
juewuy
fd3cfe3881 Merge pull request #1209 from sofia-riese/chore-2
chore: invoke the common.sh componen and UI adjustments
2026-02-03 20:42:38 +08:00
sofia-riese
6e83081865 chore: invoke the common.sh componen and UI adjustments 2026-02-03 20:40:02 +08:00
juewuy
901b4b30c0 Merge pull request #1208 from sofia-riese/chore-1
chore: invoke the common.sh componen and UI adjustments
2026-02-03 19:12:10 +08:00
sofia-riese
3aaa8b6460 chore: invoke the common.sh componen 2026-02-03 19:04:12 +08:00
juewuy
8a37ff52b6 Merge pull request #1205 from sofia-riese/chroe-7
chore(7_gateway.sh): invoke the common.sh componen
2026-02-03 17:27:46 +08:00
juewuy
a34dac4e22 Merge pull request #1206 from sofia-riese/chroe-4
chore: invoke the common.sh componen
2026-02-03 17:27:24 +08:00
sofia-riese
70aa90f584 chore: invoke the common.sh componen 2026-02-03 17:21:25 +08:00
sofia-riese
228badb65f chore(7_gateway.sh): invoke the common.sh componen 2026-02-03 15:37:15 +08:00
juewuy
dec6b6bf6f Merge pull request #1204 from Maozai-Teng/dev
修复进度条+增加文件大小显示
2026-02-03 11:06:17 +08:00
小小小猫仔
e244730f16 修复进度条+增加文件大小显示
cdn下载链接不够规范,不给content-length,导致curl原生进度条失效。
通过小巧思拿到文件大小,再手搓了一个短小精悍的进度条进行修复。
并且在下载之前增加了文件大小显示,让用户不会陷入下载焦虑~
2026-02-03 10:43:12 +08:00
juewuy
28eea7c2bc Merge branch 'master' into dev
# Conflicts:
#	ShellCrash.tar.gz
#	bin/version
#	version
2026-02-02 21:51:38 +08:00
juewuy
fd4ca02ff3 ~1.9.4r4.1 pkg 2026-02-02 21:50:43 +08:00
juewuy
b3010958ae ~1.9.5a8.1 pkg 2026-02-02 21:03:43 +08:00
juewuy
47e668152b Merge pull request #1203 from sofia-riese/redesign-1
feat(set_crashdir.sh): adapt new designs for more interfaces
2026-02-02 20:57:35 +08:00
sofia-riese
6fc2adc9b0 feat(set_crashdir.sh): adapt new designs for more interfaces 2026-02-02 20:55:50 +08:00
juewuy
25c48ecc4b ~fix & improve 2026-02-02 20:45:02 +08:00
juewuy
ac088c1adf Merge branch 'master' into dev
# Conflicts:
#	ShellCrash.tar.gz
#	bin/version
#	scripts/menus/5_task.sh
#	version
2026-02-02 20:30:29 +08:00
juewuy
7d2e1c54c4 Merge branch 'stable' of https://github.com/juewuy/ShellCrash into master 2026-02-02 20:25:42 +08:00
juewuy
f3cd3ff18a ~1.9.4r4 pkg 2026-02-02 20:25:14 +08:00
juewuy
1196557d4c ~修复部分任务命令执行失败的bug 2026-02-02 20:21:53 +08:00
juewuy
1af6cf36d2 ~修复部分情况下配置文件拉取失败的bug 2026-02-02 20:15:53 +08:00
juewuy
1f59a971cf ~修复部分小米设备Tproxy自启失效的bug 2026-02-02 20:13:04 +08:00
juewuy
9cad2c21e8 ~优化定时任务日志记录 2026-02-02 20:04:53 +08:00
juewuy
0b1d297622 ~修复华硕padavan小米等设备因意外循环重启的bug 2026-02-02 20:02:02 +08:00
juewuy
0ca7bb8eb2 ~现在跳过证书验证开关对内置下载工具也有效 2026-02-02 19:30:43 +08:00
juewuy
1bd16b5ca6 ~重写 set_cron.sh 尝试修复因为定时任务导致系统crontab内容丢失的问题 2026-02-02 19:23:03 +08:00
juewuy
643cd7ccae Merge pull request #1202 from sofia-riese/chroe-2
chore(8_tools.sh): UI adjustments
2026-02-02 19:06:07 +08:00
sofia-riese
65996d6a54 Update 8_tools.sh 2026-02-02 19:04:32 +08:00
sofia-riese
111b151cba chore(8_tools.sh): UI adjustments 2026-02-02 19:02:37 +08:00
juewuy
b1366df6b1 Merge pull request #1201 from sofia-riese/chore-1
chore(menu.sh): UI adjustments
2026-02-02 18:47:08 +08:00
sofia-riese
de154158fa chore(menu.sh): UI adjustments 2026-02-02 18:44:59 +08:00
juewuy
eac695a0f5 Merge pull request #1194 from sofia-riese/redesign-2
chore(8_tools.sh): invoke the common.sh componen
2026-02-02 18:03:05 +08:00
juewuy
b65cd1f54c Merge pull request #1196 from sofia-riese/redesign-3
chore(1_start.sh): invoke the common.sh componen
2026-02-01 16:33:58 +08:00
sofia-riese
ce1295610d chore(1_start.sh): invoke the common.sh componen 2026-02-01 16:18:43 +08:00
juewuy
1f6535c532 Merge pull request #1195 from sofia-riese/dev
chore(2_settings.sh): invoke the common.sh componen
2026-02-01 15:26:50 +08:00
sofia-riese
84008a81bd chore(2_settings.sh): invoke the common.sh componen 2026-02-01 12:28:01 +08:00
sofia-riese
5ea24d1ca4 chore(8_tools.sh): invoke the common.sh componen 2026-01-31 23:11:14 +08:00
juewuy
a38c50fa1c Merge pull request #1193 from sofia-riese/redesign-1
chore(9_upgrade.sh): invoke the common.sh component
2026-01-31 22:23:04 +08:00
sofia-riese
be60423f08 chore(9_upgrade.sh): invoke the common.sh component 2026-01-31 22:19:09 +08:00
juewuy
88ae50bc43 Merge pull request #1192 from juewuy/master
~1.9.4r3 pkg
2026-01-31 20:25:20 +08:00
juewuy
fe27f4c3e4 ~1.9.5a8 pkg 2026-01-31 20:02:31 +08:00
juewuy
8cab9b5419 ~bug fix 2026-01-31 20:01:52 +08:00
juewuy
41bd93766b ~文本优化 2026-01-31 20:00:40 +08:00
juewuy
7f52ee60d9 ~bug fix 2026-01-31 19:22:17 +08:00
juewuy
d7f93d1e62 ~bug fix and improve fw_filter.sh 2026-01-31 19:16:58 +08:00
juewuy
346d480a13 ~修复部分情况下在线生成配置文件总是失败的bug 2026-01-31 18:58:25 +08:00
juewuy
89cf950490 ~bug fix 2026-01-31 18:45:59 +08:00
juewuy
ced3c3ac59 ~bugs fix 2026-01-31 18:31:50 +08:00
juewuy
3682a99a79 ~bug fix 2026-01-31 18:07:26 +08:00
juewuy
70b2816c04 ~fix local install 2026-01-31 18:06:28 +08:00
juewuy
b348535414 Merge branch 'dev' of https://github.com/juewuy/ShellCrash into dev 2026-01-31 18:04:17 +08:00
juewuy
8fc3f34ca8 Merge branch 'master' into dev
# Conflicts:
#	ShellCrash.tar.gz
#	bin/version
#	scripts/menus/2_settings.sh
#	scripts/starts/singbox_modify.sh
#	version
2026-01-31 18:04:09 +08:00
juewuy
1129eb79b5 ~1.9.4r3 pkg 2026-01-31 17:59:04 +08:00
juewuy
4e96a8c9b1 Merge pull request #1191 from sofia-riese/redesign-4
chore(menu.sh): invoke the common.sh component
2026-01-31 17:54:17 +08:00
juewuy
dfae7195b3 ~修复TG-BOT无法使用自定义命令呼出的bug 2026-01-31 17:42:07 +08:00
sofia-riese
b493fba176 update 2026-01-31 17:35:08 +08:00
sofia-riese
6fd9f9df03 chore(menu.sh): invoke the common.sh component 2026-01-31 17:34:52 +08:00
juewuy
da23b70ca4 ~singbox内核改为默认启用sniff 2026-01-31 17:34:50 +08:00
juewuy
70bd8ed591 ~修复局域网过滤显示异常 2026-01-31 17:30:18 +08:00
juewuy
b17286b73b ~优化定时任务实现,尝试修复意外清空定时任务内容的bug 2026-01-31 17:26:48 +08:00
juewuy
d63b75b790 ~修复TG-BOT无法正确设置版本号和路由状态的bug 2026-01-31 17:14:57 +08:00
juewuy
2536cae8fe Merge pull request #1190 from sofia-riese/redesign-3
feat: improve UI/UX
2026-01-31 14:04:40 +08:00
sofia-riese
07920b35ce feat: improve UI/UX 2026-01-31 13:40:16 +08:00
juewuy
01174fa6d4 Merge pull request #1189 from sofia-riese/redesign-2
feat(override.sh): improve UI/UX
2026-01-30 22:04:30 +08:00
sofia-riese
7aa4a49ec9 feat(override.sh): improve UI/UX 2026-01-30 21:57:34 +08:00
juewuy
83bed2f3f3 Merge pull request #1187 from sofia-riese/redesign-1
feat: improve UI/UX
2026-01-29 22:18:55 +08:00
sofia-riese
2625d7f4e4 feat: improve UI/UX 2026-01-29 22:13:29 +08:00
juewuy
6fdc38b4b0 Merge pull request #1186 from sofia-riese/redesign-6
feat(6_core_config.sh): improve UI/UX
2026-01-29 07:55:39 +08:00
sofia-riese
44907fb3a2 feat(6_core_config.sh): improve UI/UX 2026-01-28 22:22:40 +08:00
juewuy
a5c2dcd482 ~1.9.5a7 pkg 2026-01-27 20:18:23 +08:00
juewuy
7c7ce098cb Merge branch 'master' into dev
# Conflicts:
#	ShellCrash.tar.gz
#	bin/version
#	version
2026-01-27 20:17:46 +08:00
juewuy
6170a0461d ~1.9.4r2 pkg
~修复小闪存模式启动失败的bug
2026-01-27 20:14:50 +08:00
juewuy
48705a0dd9 ~修复小闪存模式内核位置错乱的bug 2026-01-27 19:54:10 +08:00
juewuy
4a2a982c8d ~修复部分小米设备自启失败的bug 2026-01-27 19:33:31 +08:00
juewuy
1dadeb8d7a ~修复部分小米设备自启失败的bug 2026-01-27 19:32:02 +08:00
juewuy
f128560d97 ~Improve UI and i18n for userguide.sh 2026-01-27 18:46:14 +08:00
juewuy
4f119380a4 ~Improve UI and i18n for userguide.sh 2026-01-27 18:20:16 +08:00
juewuy
17f30cba33 ~1.9.5a6.4 pkg 2026-01-27 17:37:46 +08:00
83 changed files with 2990 additions and 3537 deletions

View File

@@ -20,6 +20,7 @@ jobs:
[ "${{ inputs.tag1 }}" = singbox ] && repo="SagerNet/sing-box" [ "${{ inputs.tag1 }}" = singbox ] && repo="SagerNet/sing-box"
[ "${{ inputs.tag1 }}" = singboxr ] && repo="SagerNet/sing-box" [ "${{ inputs.tag1 }}" = singboxr ] && repo="SagerNet/sing-box"
latest_tag=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r .tag_name) latest_tag=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r .tag_name)
[ "${{ inputs.tag1 }}" = singboxr ] && latest_tag="${latest_tag}-reF1nd"
echo "version=$latest_tag" >> $GITHUB_OUTPUT echo "version=$latest_tag" >> $GITHUB_OUTPUT
update_meta_upx: update_meta_upx:

View File

@@ -57,8 +57,7 @@ RUN apk add --no-cache \
ca-certificates \ ca-certificates \
tzdata \ tzdata \
nftables \ nftables \
iproute2 \ iproute2
dcron
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \ RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
echo "${TZ}" > /etc/timezone echo "${TZ}" > /etc/timezone

View File

@@ -188,5 +188,4 @@ crash -h # 查看命令帮助列表
## :airplane: 机场推荐 ## :airplane: 机场推荐
- [**Dler-墙洞**](https://dler.pro/auth/register?affid=89698),多年稳定运行,功能齐全。
- [**大米**](https://1s.bigmeok.me/user#/register?code=2PuWY9I7),群友力荐,流媒体解锁,月付推荐。 - [**大米**](https://1s.bigmeok.me/user#/register?code=2PuWY9I7),群友力荐,流媒体解锁,月付推荐。

Binary file not shown.

View File

@@ -1,4 +1,4 @@
meta_v=v1.19.17 meta_v=v1.19.17
singboxr_v=1.13.0-alpha.27 singboxr_v=1.13.0-alpha.27
versionsh=1.9.5alpha6.3 versionsh=1.9.5alpha11
GeoIP_v=20251205 GeoIP_v=20251205

View File

@@ -57,6 +57,7 @@ docker run -d \
--cap-add NET_ADMIN \ --cap-add NET_ADMIN \
--cap-add NET_RAW \ --cap-add NET_RAW \
--cap-add SYS_ADMIN \ --cap-add SYS_ADMIN \
--sysctl net.ipv4.ip_forward=1 \
--device /dev/net/tun:/dev/net/tun \ --device /dev/net/tun:/dev/net/tun \
--restart unless-stopped \ --restart unless-stopped \
juewuy/shellcrash:latest juewuy/shellcrash:latest
@@ -87,14 +88,10 @@ mkdir -p /root/ShellCrash
```shell ```shell
docker run -d \ docker run -d \
……………… ………………
-v /root/ShellCrash:/etc/ShellCrash \ -v shellcrash_configs:/etc/ShellCrash/configs \
……………… ………………
``` ```
------
------ ------
## Compose DeploymentCompose部署 ## Compose DeploymentCompose部署
@@ -102,8 +99,8 @@ docker run -d \
### 1. 创建宿主机目录并进入目录 ### 1. 创建宿主机目录并进入目录
```shell ```shell
mkdir -p /root/ShellCrash mkdir -p /tmp/ShellCrash
cd /root/ShellCrash cd /tmp/ShellCrash
``` ```
### 2. 下载Compose模版 ### 2. 下载Compose模版
@@ -126,8 +123,29 @@ docker compose up -d
------ ------
### Notes ## Delete移除容器镜像或删除卷
### Docker删除容器
```shell
docker rm -f shellcrash
```
### Docker删除卷
```shell
docker volume rm shellcrash_configs
```
### Compose删除容器&卷
```shell
docker-compose down -v
```
## Notes
- 内置公网防火墙功能无法管理宿主机网络请自行做好宿主机7890/9999端口的网络防护
- 旁路由模式需要宿主机支持 `TUN` - 旁路由模式需要宿主机支持 `TUN`
- macvlan 网络下宿主机默认无法直接访问容器 IP - macvlan 网络下宿主机默认无法直接访问容器 IP
- 透明代理场景可能需要额外的网络规划 - 透明代理场景可能需要额外的网络规划

View File

@@ -14,11 +14,15 @@ services:
devices: devices:
- "/dev/net/tun:/dev/net/tun" - "/dev/net/tun:/dev/net/tun"
sysctls: sysctls:
net.ipv4.ip_forward: 1 - net.ipv4.ip_forward: 1
# - net.ipv6.conf.all.forwarding=1
volumes: volumes:
- /etc/ShellCrash:/root/ShellCrash - shellcrash_configs:/etc/ShellCrash/configs:rw
restart: unless-stopped restart: unless-stopped
volumes:
shellcrash_configs:
networks: networks:
macvlan_lan: macvlan_lan:
name: macvlan_lan name: macvlan_lan

View File

@@ -1,25 +1,25 @@
#DustinWin-geosite全分组规则+去广告 #DustinWin-geosite全分组规则+去广告
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]} - {name: 🕹️ 游戏平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🎮 游戏平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]} - {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]} - {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]}
- {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true} - {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true}
- {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true} - {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -39,15 +39,14 @@ rules:
- GEOSITE,apple-cn,🍎 苹果服务 - GEOSITE,apple-cn,🍎 苹果服务
- GEOSITE,google-cn,🇬 谷歌服务 - GEOSITE,google-cn,🇬 谷歌服务
- GEOSITE,games-cn,🎮 游戏服务 - GEOSITE,games-cn,🎮 游戏服务
- GEOSITE,games,🕹️ 游戏平台
- GEOSITE,media,🌍 国外媒体 - GEOSITE,media,🌍 国外媒体
- GEOSITE,games,🎮 游戏平台
- GEOSITE,ai,🤖 AI 平台 - GEOSITE,ai,🤖 AI 平台
- GEOSITE,networktest,📈 网络测试 - GEOSITE,networktest,📈 网络测试
- GEOSITE,proxy,🧱 代理域名 - GEOSITE,proxy,🌎 国外域名
- GEOSITE,cn,🛡️ 直连域名 - GEOSITE,cn,🇨🇳 国内域名
- GEOIP,private,🔒 私有网络,no-resolve - GEOIP,private,🔒 私有网络,no-resolve
- GEOIP,cn,🀄️ 直连 IP - GEOIP,cn,🀄️ 国内 IP
- GEOIP,media,🌍 国外媒体
- GEOIP,games,🎮 游戏平台
- GEOIP,telegram,📲 电报消息,no-resolve - GEOIP,telegram,📲 电报消息,no-resolve
- GEOIP,media,🌍 国外媒体
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,22 +1,22 @@
#DustinWin-geosite全分组规则 #DustinWin-geosite全分组规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]} - {name: 🕹️ 游戏平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🎮 游戏平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]} - {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -35,15 +35,14 @@ rules:
- GEOSITE,apple-cn,🍎 苹果服务 - GEOSITE,apple-cn,🍎 苹果服务
- GEOSITE,google-cn,🇬 谷歌服务 - GEOSITE,google-cn,🇬 谷歌服务
- GEOSITE,games-cn,🎮 游戏服务 - GEOSITE,games-cn,🎮 游戏服务
- GEOSITE,games,🕹️ 游戏平台
- GEOSITE,media,🌍 国外媒体 - GEOSITE,media,🌍 国外媒体
- GEOSITE,games,🎮 游戏平台
- GEOSITE,ai,🤖 AI 平台 - GEOSITE,ai,🤖 AI 平台
- GEOSITE,networktest,📈 网络测试 - GEOSITE,networktest,📈 网络测试
- GEOSITE,proxy,🧱 代理域名 - GEOSITE,proxy,🌎 国外域名
- GEOSITE,cn,🛡️ 直连域名 - GEOSITE,cn,🇨🇳 国内域名
- GEOIP,private,🔒 私有网络,no-resolve - GEOIP,private,🔒 私有网络,no-resolve
- GEOIP,cn,🀄️ 直连 IP - GEOIP,cn,🀄️ 国内 IP
- GEOIP,media,🌍 国外媒体
- GEOIP,games,🎮 游戏平台
- GEOIP,telegram,📲 电报消息,no-resolve - GEOIP,telegram,📲 电报消息,no-resolve
- GEOIP,media,🌍 国外媒体
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,12 +1,12 @@
#DustinWin-gesite轻量规则 #DustinWin-gesite轻量规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]} - {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [全球直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -20,9 +20,9 @@ proxy-groups:
rules: rules:
- GEOSITE,private,🔒 私有网络 - GEOSITE,private,🔒 私有网络
- GEOSITE,tld-proxy,🧱 代理域名 - GEOSITE,tld-proxy,🌎 国外域名
- GEOSITE,proxy,🧱 代理域名 - GEOSITE,proxy,🌎 国外域名
- GEOIP,private,🔒 私有网络,no-resolve - GEOIP,private,🔒 私有网络,no-resolve
- GEOIP,cn,🀄️ 直连 IP - GEOIP,cn,🀄️ 国内 IP
- GEOIP,telegram,📲 电报消息,no-resolve - GEOIP,telegram,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,23 +1,23 @@
#DustinWin-geosite标准规则+去广告 #DustinWin-geosite标准规则+去广告
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]} - {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]} - {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]}
- {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true} - {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true}
- {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true} - {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -39,9 +39,9 @@ rules:
- GEOSITE,games-cn,🎮 游戏服务 - GEOSITE,games-cn,🎮 游戏服务
- GEOSITE,ai,🤖 AI 平台 - GEOSITE,ai,🤖 AI 平台
- GEOSITE,networktest,📈 网络测试 - GEOSITE,networktest,📈 网络测试
- GEOSITE,proxy,🧱 代理域名 - GEOSITE,proxy,🌎 国外域名
- GEOSITE,cn,🛡️ 直连域名 - GEOSITE,cn,🇨🇳 国内域名
- GEOIP,private,🔒 私有网络,no-resolve - GEOIP,private,🔒 私有网络,no-resolve
- GEOIP,cn,🀄️ 直连 IP - GEOIP,cn,🀄️ 国内 IP
- GEOIP,telegram,📲 电报消息,no-resolve - GEOIP,telegram,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,20 +1,20 @@
#DustinWin-geosite标准规则 #DustinWin-geosite标准规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]} - {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -35,9 +35,9 @@ rules:
- GEOSITE,games-cn,🎮 游戏服务 - GEOSITE,games-cn,🎮 游戏服务
- GEOSITE,ai,🤖 AI 平台 - GEOSITE,ai,🤖 AI 平台
- GEOSITE,networktest,📈 网络测试 - GEOSITE,networktest,📈 网络测试
- GEOSITE,proxy,🧱 代理域名 - GEOSITE,proxy,🌎 国外域名
- GEOSITE,cn,🛡️ 直连域名 - GEOSITE,cn,🇨🇳 国内域名
- GEOIP,private,🔒 私有网络,no-resolve - GEOIP,private,🔒 私有网络,no-resolve
- GEOIP,cn,🀄️ 直连 IP - GEOIP,cn,🀄️ 国内 IP
- GEOIP,telegram,📲 电报消息,no-resolve - GEOIP,telegram,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,27 +1,27 @@
#DustinWin-ruleset全分组规则+去广告 #DustinWin-ruleset全分组规则+去广告
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]} - {name: 🕹️ 游戏平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🎥 奈飞视频, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🎥 奈飞视频, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 📹 油管视频, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📹 油管视频, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🎮 游戏平台, type: select, proxies: [🚀 节点选择, 🎯 全球直连, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]} - {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]} - {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]}
- {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true} - {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true}
- {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true} - {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -34,20 +34,20 @@ proxy-groups:
- {name: 🇺🇸 美国节点, type: url-test, tolerance: 100, include-all: true, filter: "(?i)(🇺🇸|美|us|unitedstates|united states)"} - {name: 🇺🇸 美国节点, type: url-test, tolerance: 100, include-all: true, filter: "(?i)(🇺🇸|美|us|unitedstates|united states)"}
rule-providers: rule-providers:
private:
type: http
behavior: domain
format: mrs
path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/private.mrs"
interval: 86400
ads: ads:
type: http type: http
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ads.mrs path: ./ruleset/ads.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ads.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ads.mrs"
interval: 86400
private:
type: http
behavior: domain
format: mrs
path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/private.mrs"
interval: 86400 interval: 86400
trackerslist: trackerslist:
@@ -55,7 +55,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/trackerslist.mrs path: ./ruleset/trackerslist.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/trackerslist.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/trackerslist.mrs"
interval: 86400 interval: 86400
microsoft-cn: microsoft-cn:
@@ -63,7 +63,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/microsoft-cn.mrs path: ./ruleset/microsoft-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/microsoft-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/microsoft-cn.mrs"
interval: 86400 interval: 86400
apple-cn: apple-cn:
@@ -71,7 +71,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/apple-cn.mrs path: ./ruleset/apple-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/apple-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/apple-cn.mrs"
interval: 86400 interval: 86400
google-cn: google-cn:
@@ -79,7 +79,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/google-cn.mrs path: ./ruleset/google-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/google-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/google-cn.mrs"
interval: 86400 interval: 86400
games-cn: games-cn:
@@ -87,15 +87,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/games-cn.mrs path: ./ruleset/games-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games-cn.mrs"
interval: 86400
media:
type: http
behavior: domain
format: mrs
path: ./ruleset/media.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/media.mrs"
interval: 86400 interval: 86400
games: games:
@@ -103,7 +95,31 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/games.mrs path: ./ruleset/games.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games.mrs"
interval: 86400
netflix:
type: http
behavior: domain
format: mrs
path: ./ruleset/netflix.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/netflix.mrs"
interval: 86400
youtube:
type: http
behavior: domain
format: mrs
path: ./ruleset/youtube.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/youtube.mrs"
interval: 86400
media:
type: http
behavior: domain
format: mrs
path: ./ruleset/media.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/media.mrs"
interval: 86400 interval: 86400
ai: ai:
@@ -111,7 +127,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ai.mrs path: ./ruleset/ai.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ai.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ai.mrs"
interval: 86400 interval: 86400
networktest: networktest:
@@ -119,7 +135,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/networktest.mrs path: ./ruleset/networktest.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/networktest.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/networktest.mrs"
interval: 86400 interval: 86400
proxy: proxy:
@@ -127,7 +143,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/proxy.mrs path: ./ruleset/proxy.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/proxy.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/proxy.mrs"
interval: 86400 interval: 86400
cn: cn:
@@ -135,7 +151,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
privateip: privateip:
@@ -143,7 +159,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
@@ -151,23 +167,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs"
interval: 86400
mediaip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/mediaip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/mediaip.mrs"
interval: 86400
gamesip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/gamesip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/gamesip.mrs"
interval: 86400 interval: 86400
telegramip: telegramip:
@@ -175,7 +175,23 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/telegramip.mrs path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/telegramip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/telegramip.mrs"
interval: 86400
netflixip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/netflixip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/netflixip.mrs"
interval: 86400
mediaip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/mediaip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/mediaip.mrs"
interval: 86400 interval: 86400
rules: rules:
@@ -186,15 +202,17 @@ rules:
- RULE-SET,apple-cn,🍎 苹果服务 - RULE-SET,apple-cn,🍎 苹果服务
- RULE-SET,google-cn,🇬 谷歌服务 - RULE-SET,google-cn,🇬 谷歌服务
- RULE-SET,games-cn,🎮 游戏服务 - RULE-SET,games-cn,🎮 游戏服务
- RULE-SET,games,🕹️ 游戏平台
- RULE-SET,netflix,🎥 奈飞视频
- RULE-SET,youtube,📹 油管视频
- RULE-SET,media,🌍 国外媒体 - RULE-SET,media,🌍 国外媒体
- RULE-SET,games,🎮 游戏平台
- RULE-SET,ai,🤖 AI 平台 - RULE-SET,ai,🤖 AI 平台
- RULE-SET,networktest,📈 网络测试 - RULE-SET,networktest,📈 网络测试
- RULE-SET,proxy,🧱 代理域名 - RULE-SET,proxy,🌎 国外域名
- RULE-SET,cn,🛡️ 直连域名 - RULE-SET,cn,🇨🇳 国内域名
- RULE-SET,privateip,🔒 私有网络,no-resolve - RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,cnip,🀄️ 直连 IP - RULE-SET,cnip,🀄️ 国内 IP
- RULE-SET,mediaip,🌍 国外媒体
- RULE-SET,gamesip,🎮 游戏平台
- RULE-SET,telegramip,📲 电报消息,no-resolve - RULE-SET,telegramip,📲 电报消息,no-resolve
- RULE-SET,netflixip,🎥 奈飞视频
- RULE-SET,mediaip,🌍 国外媒体
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,24 +1,24 @@
#DustinWin-ruleset全分组规则 #DustinWin-ruleset全分组规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]} - {name: 🕹️ 游戏平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🎥 奈飞视频, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 📹 油管视频, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🎥 奈飞视频, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📹 油管视频, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🎮 游戏平台, type: select, proxies: [🚀 节点选择, 🎯 全球直连, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🌍 国外媒体, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]} - {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -36,7 +36,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/private.mrs path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/private.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/private.mrs"
interval: 86400 interval: 86400
trackerslist: trackerslist:
@@ -44,7 +44,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/trackerslist.mrs path: ./ruleset/trackerslist.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/trackerslist.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/trackerslist.mrs"
interval: 86400 interval: 86400
microsoft-cn: microsoft-cn:
@@ -52,7 +52,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/microsoft-cn.mrs path: ./ruleset/microsoft-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/microsoft-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/microsoft-cn.mrs"
interval: 86400 interval: 86400
apple-cn: apple-cn:
@@ -60,7 +60,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/apple-cn.mrs path: ./ruleset/apple-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/apple-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/apple-cn.mrs"
interval: 86400 interval: 86400
google-cn: google-cn:
@@ -68,7 +68,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/google-cn.mrs path: ./ruleset/google-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/google-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/google-cn.mrs"
interval: 86400 interval: 86400
games-cn: games-cn:
@@ -76,31 +76,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/games-cn.mrs path: ./ruleset/games-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games-cn.mrs"
interval: 86400
netflix:
type: http
behavior: domain
format: mrs
path: ./ruleset/netflix.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/netflix.mrs"
interval: 86400
youtube:
type: http
behavior: domain
format: mrs
path: ./ruleset/youtube.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/youtube.mrs"
interval: 86400
media:
type: http
behavior: domain
format: mrs
path: ./ruleset/media.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/media.mrs"
interval: 86400 interval: 86400
games: games:
@@ -108,7 +84,31 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/games.mrs path: ./ruleset/games.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games.mrs"
interval: 86400
netflix:
type: http
behavior: domain
format: mrs
path: ./ruleset/netflix.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/netflix.mrs"
interval: 86400
youtube:
type: http
behavior: domain
format: mrs
path: ./ruleset/youtube.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/youtube.mrs"
interval: 86400
media:
type: http
behavior: domain
format: mrs
path: ./ruleset/media.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/media.mrs"
interval: 86400 interval: 86400
ai: ai:
@@ -116,7 +116,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ai.mrs path: ./ruleset/ai.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ai.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ai.mrs"
interval: 86400 interval: 86400
networktest: networktest:
@@ -124,7 +124,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/networktest.mrs path: ./ruleset/networktest.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/networktest.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/networktest.mrs"
interval: 86400 interval: 86400
proxy: proxy:
@@ -132,7 +132,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/proxy.mrs path: ./ruleset/proxy.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/proxy.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/proxy.mrs"
interval: 86400 interval: 86400
cn: cn:
@@ -140,7 +140,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
privateip: privateip:
@@ -148,7 +148,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
@@ -156,31 +156,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs"
interval: 86400
netflixip:
type: http
behavior: domain
format: mrs
path: ./ruleset/netflixip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/netflixip.mrs"
interval: 86400
mediaip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/mediaip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/mediaip.mrs"
interval: 86400
gamesip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/gamesip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/gamesip.mrs"
interval: 86400 interval: 86400
telegramip: telegramip:
@@ -188,7 +164,23 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/telegramip.mrs path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/telegramip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/telegramip.mrs"
interval: 86400
netflixip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/netflixip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/netflixip.mrs"
interval: 86400
mediaip:
type: http
behavior: ipcidr
format: mrs
path: ./ruleset/mediaip.mrs
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/mediaip.mrs"
interval: 86400 interval: 86400
rules: rules:
@@ -198,18 +190,17 @@ rules:
- RULE-SET,apple-cn,🍎 苹果服务 - RULE-SET,apple-cn,🍎 苹果服务
- RULE-SET,google-cn,🇬 谷歌服务 - RULE-SET,google-cn,🇬 谷歌服务
- RULE-SET,games-cn,🎮 游戏服务 - RULE-SET,games-cn,🎮 游戏服务
- RULE-SET,games,🕹️ 游戏平台
- RULE-SET,netflix,🎥 奈飞视频 - RULE-SET,netflix,🎥 奈飞视频
- RULE-SET,youtube,📹 油管视频 - RULE-SET,youtube,📹 油管视频
- RULE-SET,media,🌍 国外媒体 - RULE-SET,media,🌍 国外媒体
- RULE-SET,games,🎮 游戏平台
- RULE-SET,ai,🤖 AI 平台 - RULE-SET,ai,🤖 AI 平台
- RULE-SET,networktest,📈 网络测试 - RULE-SET,networktest,📈 网络测试
- RULE-SET,proxy,🧱 代理域名 - RULE-SET,proxy,🌎 国外域名
- RULE-SET,cn,🛡️ 直连域名 - RULE-SET,cn,🇨🇳 国内域名
- RULE-SET,privateip,🔒 私有网络,no-resolve - RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,cnip,🀄️ 直连 IP - RULE-SET,cnip,🀄️ 国内 IP
- RULE-SET,telegramip,📲 电报消息,no-resolve
- RULE-SET,netflixip,🎥 奈飞视频 - RULE-SET,netflixip,🎥 奈飞视频
- RULE-SET,mediaip,🌍 国外媒体 - RULE-SET,mediaip,🌍 国外媒体
- RULE-SET,gamesip,🎮 游戏平台
- RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,10 +1,10 @@
#DustinWin-ruleset轻量规则 #DustinWin-ruleset轻量规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT, 🚀 节点选择]} - {name: 🎯 本地直连, type: select, proxies: [DIRECT, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, DIRECT]} - {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, DIRECT]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -22,7 +22,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
private: private:
@@ -30,7 +30,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/private.mrs path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/private.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/private.mrs"
interval: 86400 interval: 86400
tld-proxy: tld-proxy:
@@ -38,7 +38,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/tld-proxy.mrs path: ./ruleset/tld-proxy.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/tld-proxy.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/tld-proxy.mrs"
interval: 86400 interval: 86400
proxy: proxy:
@@ -46,7 +46,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/proxy.mrs path: ./ruleset/proxy.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/proxy.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/proxy.mrs"
interval: 86400 interval: 86400
privateip: privateip:
@@ -54,7 +54,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
@@ -62,7 +62,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs"
interval: 86400 interval: 86400
telegramip: telegramip:
@@ -70,15 +70,15 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/telegramip.mrs path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/telegramip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/telegramip.mrs"
interval: 86400 interval: 86400
rules: rules:
- RULE-SET,private,DIRECT - RULE-SET,private,DIRECT
- RULE-SET,tld-proxy,🧱 代理域名 - RULE-SET,tld-proxy,🌎 国外域名
- RULE-SET,proxy,🧱 代理域名 - RULE-SET,proxy,🌎 国外域名
- RULE-SET,cn,🎯 全球直连 - RULE-SET,cn,🎯 本地直连
- RULE-SET,privateip,DIRECT,no-resolve - RULE-SET,privateip,DIRECT,no-resolve
- RULE-SET,cnip,🎯 全球直连 - RULE-SET,cnip,🎯 本地直连
- RULE-SET,telegramip,📲 电报消息,no-resolve - RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,23 +1,23 @@
#DustinWin-ruleset标准规则+去广告 #DustinWin-ruleset标准规则+去广告
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]} - {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]} - {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]}
- {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true} - {name: 🔴 全球拦截, type: select, proxies: [REJECT], hidden: true}
- {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true} - {name: 🟢 全球绕过, type: select, proxies: [PASS], hidden: true}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -35,7 +35,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/private.mrs path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/private.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/private.mrs"
interval: 86400 interval: 86400
ads: ads:
@@ -43,7 +43,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ads.mrs path: ./ruleset/ads.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ads.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ads.mrs"
interval: 86400 interval: 86400
trackerslist: trackerslist:
@@ -51,7 +51,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/trackerslist.mrs path: ./ruleset/trackerslist.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/trackerslist.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/trackerslist.mrs"
interval: 86400 interval: 86400
microsoft-cn: microsoft-cn:
@@ -59,7 +59,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/microsoft-cn.mrs path: ./ruleset/microsoft-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/microsoft-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/microsoft-cn.mrs"
interval: 86400 interval: 86400
apple-cn: apple-cn:
@@ -67,7 +67,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/apple-cn.mrs path: ./ruleset/apple-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/apple-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/apple-cn.mrs"
interval: 86400 interval: 86400
google-cn: google-cn:
@@ -75,7 +75,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/google-cn.mrs path: ./ruleset/google-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/google-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/google-cn.mrs"
interval: 86400 interval: 86400
games-cn: games-cn:
@@ -83,7 +83,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/games-cn.mrs path: ./ruleset/games-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games-cn.mrs"
interval: 86400 interval: 86400
ai: ai:
@@ -91,7 +91,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ai.mrs path: ./ruleset/ai.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ai.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ai.mrs"
interval: 86400 interval: 86400
networktest: networktest:
@@ -99,7 +99,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/networktest.mrs path: ./ruleset/networktest.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/networktest.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/networktest.mrs"
interval: 86400 interval: 86400
proxy: proxy:
@@ -107,7 +107,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/proxy.mrs path: ./ruleset/proxy.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/proxy.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/proxy.mrs"
interval: 86400 interval: 86400
cn: cn:
@@ -115,7 +115,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
privateip: privateip:
@@ -123,7 +123,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
@@ -131,7 +131,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs"
interval: 86400 interval: 86400
telegramip: telegramip:
@@ -139,7 +139,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/telegramip.mrs path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/telegramip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/telegramip.mrs"
interval: 86400 interval: 86400
rules: rules:
@@ -152,9 +152,9 @@ rules:
- RULE-SET,games-cn,🎮 游戏服务 - RULE-SET,games-cn,🎮 游戏服务
- RULE-SET,ai,🤖 AI 平台 - RULE-SET,ai,🤖 AI 平台
- RULE-SET,networktest,📈 网络测试 - RULE-SET,networktest,📈 网络测试
- RULE-SET,proxy,🧱 代理域名 - RULE-SET,proxy,🌎 国外域名
- RULE-SET,cn,🛡️ 直连域名 - RULE-SET,cn,🇨🇳 国内域名
- RULE-SET,privateip,🔒 私有网络,no-resolve - RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,cnip,🀄️ 直连 IP - RULE-SET,cnip,🀄️ 国内 IP
- RULE-SET,telegramip,📲 电报消息,no-resolve - RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,20 +1,20 @@
#DustinWin-ruleset标准规则 #DustinWin-ruleset标准规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点]} - {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {name: 📋 Trackerslist, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 📋 Trackerslist, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🎮 游戏服务, type: select, proxies: [🎯 全球直连, 👑 高级节点, 🚀 节点选择]} - {name: 🎮 游戏服务, type: select, proxies: [🎯 本地直连, 👑 高级节点, 🚀 节点选择]}
- {name: 🪟 微软服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🪟 微软服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🇬 谷歌服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇬 谷歌服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🍎 苹果服务, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🍎 苹果服务, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🛡️ 直连域名, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🇨🇳 国内域名, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]} - {name: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]} - {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]} - {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true} - {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]} - {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true} - {name: 🎯 本地直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"} - {name: 👑 高级节点, type: url-test, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高倍率|游戏|game|IEPL|IPLC|AIA|CTM|CC|AC)"}
- {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"} - {name: 📉 省流节点, type: url-test, tolerance: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -32,7 +32,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/private.mrs path: ./ruleset/private.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/private.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/private.mrs"
interval: 86400 interval: 86400
trackerslist: trackerslist:
@@ -40,7 +40,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/trackerslist.mrs path: ./ruleset/trackerslist.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/trackerslist.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/trackerslist.mrs"
interval: 86400 interval: 86400
microsoft-cn: microsoft-cn:
@@ -48,7 +48,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/microsoft-cn.mrs path: ./ruleset/microsoft-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/microsoft-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/microsoft-cn.mrs"
interval: 86400 interval: 86400
apple-cn: apple-cn:
@@ -56,7 +56,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/apple-cn.mrs path: ./ruleset/apple-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/apple-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/apple-cn.mrs"
interval: 86400 interval: 86400
google-cn: google-cn:
@@ -64,7 +64,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/google-cn.mrs path: ./ruleset/google-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/google-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/google-cn.mrs"
interval: 86400 interval: 86400
games-cn: games-cn:
@@ -72,7 +72,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/games-cn.mrs path: ./ruleset/games-cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games-cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/games-cn.mrs"
interval: 86400 interval: 86400
ai: ai:
@@ -80,7 +80,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/ai.mrs path: ./ruleset/ai.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/ai.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/ai.mrs"
interval: 86400 interval: 86400
networktest: networktest:
@@ -88,7 +88,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/networktest.mrs path: ./ruleset/networktest.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/networktest.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/networktest.mrs"
interval: 86400 interval: 86400
proxy: proxy:
@@ -96,7 +96,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/proxy.mrs path: ./ruleset/proxy.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/proxy.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/proxy.mrs"
interval: 86400 interval: 86400
cn: cn:
@@ -104,7 +104,7 @@ rule-providers:
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn-lite.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
privateip: privateip:
@@ -112,7 +112,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
@@ -120,7 +120,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs"
interval: 86400 interval: 86400
telegramip: telegramip:
@@ -128,7 +128,7 @@ rule-providers:
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/telegramip.mrs path: ./ruleset/telegramip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/telegramip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/telegramip.mrs"
interval: 86400 interval: 86400
rules: rules:
@@ -140,9 +140,9 @@ rules:
- RULE-SET,games-cn,🎮 游戏服务 - RULE-SET,games-cn,🎮 游戏服务
- RULE-SET,ai,🤖 AI 平台 - RULE-SET,ai,🤖 AI 平台
- RULE-SET,networktest,📈 网络测试 - RULE-SET,networktest,📈 网络测试
- RULE-SET,proxy,🧱 代理域名 - RULE-SET,proxy,🌎 国外域名
- RULE-SET,cn,🛡️ 直连域名 - RULE-SET,cn,🇨🇳 国内域名
- RULE-SET,privateip,🔒 私有网络,no-resolve - RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,cnip,🀄️ 直连 IP - RULE-SET,cnip,🀄️ 国内 IP
- RULE-SET,telegramip,📲 电报消息,no-resolve - RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼 - MATCH,🐟 漏网之鱼

View File

@@ -1,7 +1,7 @@
#ShellCrash-geosite极简规则 #ShellCrash-geosite极简规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [{providers_tags}], include-all: true} - {name: 🚀 节点选择, type: select, proxies: [{providers_tags}], include-all: true}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT, 🚀 节点选择]} - {name: 🎯 本地直连, type: select, proxies: [DIRECT, 🚀 节点选择]}
rules: rules:
- GEOIP,cn,🎯 全球直连 - GEOIP,cn,🎯 本地直连
- MATCH,🚀 节点选择 - MATCH,🚀 节点选择

View File

@@ -169,13 +169,6 @@ rule-providers:
behavior: domain behavior: domain
proxy: DIRECT proxy: DIRECT
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/games.mrs"
gamesip:
type: http
format: mrs
interval: 86400
behavior: ipcidr
proxy: DIRECT
url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/gamesip.mrs"
mediaip: mediaip:
type: http type: http
format: mrs format: mrs
@@ -247,7 +240,6 @@ rules:
- RULE-SET,proxy,🌐 国际流量 - RULE-SET,proxy,🌐 国际流量
- RULE-SET,cn,🀄️ 国内流量 - RULE-SET,cn,🀄️ 国内流量
- RULE-SET,gamesip,🎮 外服游戏
- RULE-SET,mediaip,🌍 国际媒体 - RULE-SET,mediaip,🌍 国际媒体
- RULE-SET,cnip,🀄️ 国内流量 - RULE-SET,cnip,🀄️ 国内流量

View File

@@ -1,31 +1,31 @@
#ShellCrash-ruleset极简规则 #ShellCrash-ruleset极简规则
proxy-groups: proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [{providers_tags}], include-all: true} - {name: 🚀 节点选择, type: select, proxies: [{providers_tags}], include-all: true}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT, 🚀 节点选择]} - {name: 🎯 本地直连, type: select, proxies: [DIRECT, 🚀 节点选择]}
rule-providers: rule-providers:
cn: cn:
type: http type: http
behavior: domain behavior: domain
format: mrs format: mrs
path: ./ruleset/cn.mrs path: ./ruleset/cn.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cn.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cn.mrs"
interval: 86400 interval: 86400
privateip: privateip:
type: http type: http
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/privateip.mrs path: ./ruleset/privateip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/privateip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/privateip.mrs"
interval: 86400 interval: 86400
cnip: cnip:
type: http type: http
behavior: ipcidr behavior: ipcidr
format: mrs format: mrs
path: ./ruleset/cnip.mrs path: ./ruleset/cnip.mrs
url: "https://testingcf.jsdelivr.net/gh//DustinWin/ruleset_geodata@refs/heads/mihomo-ruleset/cnip.mrs" url: "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@mihomo-ruleset/cnip.mrs"
interval: 86400 interval: 86400
rules: rules:
- RULE-SET,privateip,🎯 全球直连,no-resolve - RULE-SET,privateip,🎯 本地直连,no-resolve
- RULE-SET,cn,🎯 全球直连 - RULE-SET,cn,🎯 本地直连
- RULE-SET,cnip,🎯 全球直连 - RULE-SET,cnip,🎯 本地直连
- MATCH,🚀 节点选择 - MATCH,🚀 节点选择

View File

@@ -3,19 +3,19 @@
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] },
{ "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点" ] }, { "tag": "🕹️ 游戏平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] }, { "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] },
{ "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🎥 奈飞视频", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🎥 奈飞视频", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "📹 油管视频", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📹 油管视频", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🌍 国外媒体", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🌍 国外媒体", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🎮 游戏平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🛡️ 直连域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇨🇳 国内域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🀄️ 直连 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🀄️ 国内 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🧱 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] }, { "tag": "🌎 国外域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] },
{ "tag": "🛑 广告域名", "type": "selector", "outbounds": [ "🔴 全球拦截", "🎯 本地直连" ] }, { "tag": "🛑 广告域名", "type": "selector", "outbounds": [ "🔴 全球拦截", "🎯 本地直连" ] },
@@ -41,32 +41,23 @@
{ "rule_set": [ "apple-cn" ], "outbound": "🍎 苹果服务" }, { "rule_set": [ "apple-cn" ], "outbound": "🍎 苹果服务" },
{ "rule_set": [ "google-cn" ], "outbound": "🇬 谷歌服务" }, { "rule_set": [ "google-cn" ], "outbound": "🇬 谷歌服务" },
{ "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" }, { "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" },
{ "rule_set": [ "games" ], "outbound": "🕹️ 游戏平台" },
{ "rule_set": [ "netflix" ], "outbound": "🎥 奈飞视频" }, { "rule_set": [ "netflix" ], "outbound": "🎥 奈飞视频" },
{ "rule_set": [ "youtube" ], "outbound": "📹 油管视频" }, { "rule_set": [ "youtube" ], "outbound": "📹 油管视频" },
{ "rule_set": [ "media" ], "outbound": "🌍 国外媒体" }, { "rule_set": [ "media" ], "outbound": "🌍 国外媒体" },
{ "rule_set": [ "games" ], "outbound": "🎮 游戏平台" },
{ "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" }, { "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" },
{ "rule_set": [ "networktest" ], "outbound": "📈 网络测试" }, { "rule_set": [ "networktest" ], "outbound": "📈 网络测试" },
{ "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" }, { "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" },
{ "rule_set": [ "cn" ], "outbound": "🛡️ 直连域名" }, { "rule_set": [ "cn" ], "outbound": "🇨🇳 国内域名" },
{ "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" }, { "ip_is_private": true, "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" }, { "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
{ "rule_set": [ "cnip" ], "outbound": "🀄️ 直连 IP" }, { "rule_set": [ "cnip" ], "outbound": "🀄️ 国内 IP" },
{ "rule_set": [ "netflixip" ], "outbound": "🎥 奈飞视频" }, { "rule_set": [ "netflixip" ], "outbound": "🎥 奈飞视频" },
{ "rule_set": [ "mediaip" ], "outbound": "🌍 国外媒体" }, { "rule_set": [ "mediaip" ], "outbound": "🌍 国外媒体" }
{ "rule_set": [ "gamesip" ], "outbound": "🎮 游戏平台" }
], ],
"rule_set": [ "rule_set": [
{
"tag": "private",
"type": "remote",
"format": "binary",
"path": "./ruleset/private.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/private.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "ads", "tag": "ads",
"type": "remote", "type": "remote",
@@ -75,6 +66,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/ads.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/ads.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "private",
"type": "remote",
"format": "binary",
"path": "./ruleset/private.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/private.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "trackerslist", "tag": "trackerslist",
"type": "remote", "type": "remote",
@@ -115,6 +114,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games-cn.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games-cn.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "games",
"type": "remote",
"format": "binary",
"path": "./ruleset/games.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "netflix", "tag": "netflix",
"type": "remote", "type": "remote",
@@ -139,14 +146,6 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/media.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/media.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "games",
"type": "remote",
"format": "binary",
"path": "./ruleset/games.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "ai", "tag": "ai",
"type": "remote", "type": "remote",
@@ -180,11 +179,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "privateip", "tag": "telegramip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/privateip.srs", "path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
@@ -210,22 +209,6 @@
"path": "./ruleset/mediaip.srs", "path": "./ruleset/mediaip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/mediaip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/mediaip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
},
{
"tag": "gamesip",
"type": "remote",
"format": "binary",
"path": "./ruleset/gamesip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/gamesip.srs",
"download_detour": "DIRECT"
},
{
"tag": "telegramip",
"type": "remote",
"format": "binary",
"path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
} }
], ],
"final": "🐟 漏网之鱼" "final": "🐟 漏网之鱼"

View File

@@ -3,19 +3,19 @@
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] },
{ "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点" ] }, { "tag": "🕹️ 游戏平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] }, { "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] },
{ "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🎥 奈飞视频", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🎥 奈飞视频", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "📹 油管视频", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📹 油管视频", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🌍 国外媒体", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "🌍 国外媒体", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🎮 游戏平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🛡️ 直连域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇨🇳 国内域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🀄️ 直连 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🀄️ 国内 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🧱 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] }, { "tag": "🌎 国外域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] },
{ "tag": "🎯 本地直连", "type": "direct" }, { "tag": "🎯 本地直连", "type": "direct" },
@@ -38,22 +38,21 @@
{ "rule_set": [ "apple-cn" ], "outbound": "🍎 苹果服务" }, { "rule_set": [ "apple-cn" ], "outbound": "🍎 苹果服务" },
{ "rule_set": [ "google-cn" ], "outbound": "🇬 谷歌服务" }, { "rule_set": [ "google-cn" ], "outbound": "🇬 谷歌服务" },
{ "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" }, { "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" },
{ "rule_set": [ "games" ], "outbound": "🕹️ 游戏平台" },
{ "rule_set": [ "netflix" ], "outbound": "🎥 奈飞视频" }, { "rule_set": [ "netflix" ], "outbound": "🎥 奈飞视频" },
{ "rule_set": [ "youtube" ], "outbound": "📹 油管视频" }, { "rule_set": [ "youtube" ], "outbound": "📹 油管视频" },
{ "rule_set": [ "media" ], "outbound": "🌍 国外媒体" }, { "rule_set": [ "media" ], "outbound": "🌍 国外媒体" },
{ "rule_set": [ "games" ], "outbound": "🎮 游戏平台" },
{ "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" }, { "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" },
{ "rule_set": [ "networktest" ], "outbound": "📈 网络测试" }, { "rule_set": [ "networktest" ], "outbound": "📈 网络测试" },
{ "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" }, { "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" },
{ "rule_set": [ "cn" ], "outbound": "🛡️ 直连域名" }, { "rule_set": [ "cn" ], "outbound": "🇨🇳 国内域名" },
{ "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" }, { "ip_is_private": true, "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" }, { "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
{ "rule_set": [ "cnip" ], "outbound": "🀄️ 直连 IP" }, { "rule_set": [ "cnip" ], "outbound": "🀄️ 国内 IP" },
{ "rule_set": [ "netflixip" ], "outbound": "🎥 奈飞视频" }, { "rule_set": [ "netflixip" ], "outbound": "🎥 奈飞视频" },
{ "rule_set": [ "mediaip" ], "outbound": "🌍 国外媒体" }, { "rule_set": [ "mediaip" ], "outbound": "🌍 国外媒体" }
{ "rule_set": [ "gamesip" ], "outbound": "🎮 游戏平台" }
], ],
"rule_set": [ "rule_set": [
{ {
@@ -104,6 +103,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games-cn.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games-cn.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "games",
"type": "remote",
"format": "binary",
"path": "./ruleset/games.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "netflix", "tag": "netflix",
"type": "remote", "type": "remote",
@@ -128,14 +135,6 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/media.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/media.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "games",
"type": "remote",
"format": "binary",
"path": "./ruleset/games.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/games.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "ai", "tag": "ai",
"type": "remote", "type": "remote",
@@ -169,11 +168,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "privateip", "tag": "telegramip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/privateip.srs", "path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
@@ -199,22 +198,6 @@
"path": "./ruleset/mediaip.srs", "path": "./ruleset/mediaip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/mediaip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/mediaip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
},
{
"tag": "gamesip",
"type": "remote",
"format": "binary",
"path": "./ruleset/gamesip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/gamesip.srs",
"download_detour": "DIRECT"
},
{
"tag": "telegramip",
"type": "remote",
"format": "binary",
"path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
} }
], ],
"final": "🐟 漏网之鱼" "final": "🐟 漏网之鱼"

View File

@@ -2,7 +2,7 @@
{ {
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] },
{ "tag": "🧱 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] }, { "tag": "🌎 国外域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] },
{ "tag": "🎯 本地直连", "type": "direct" }, { "tag": "🎯 本地直连", "type": "direct" },
@@ -20,10 +20,10 @@
"route": { "route": {
"rules": [ "rules": [
{ "rule_set": [ "private" ], "outbound": "🎯 本地直连" }, { "rule_set": [ "private" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "tld-proxy" ], "outbound": "🧱 代理域名" }, { "rule_set": [ "tld-proxy" ], "outbound": "🌎 国外域名" },
{ "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" }, { "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" },
{ "rule_set": [ "cn" ], "outbound": "🎯 本地直连" }, { "rule_set": [ "cn" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" }, { "ip_is_private": true, "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" }, { "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
@@ -63,11 +63,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "privateip", "tag": "telegramip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/privateip.srs", "path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
@@ -77,14 +77,6 @@
"path": "./ruleset/cnip.srs", "path": "./ruleset/cnip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
},
{
"tag": "telegramip",
"type": "remote",
"format": "binary",
"path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
} }
], ],
"final": "🐟 漏网之鱼" "final": "🐟 漏网之鱼"

View File

@@ -3,15 +3,15 @@
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] },
{ "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点" ] }, { "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] }, { "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] },
{ "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🛡️ 直连域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇨🇳 国内域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🀄️ 直连 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🀄️ 国内 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🧱 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] }, { "tag": "🌎 国外域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] },
{ "tag": "🛑 广告域名", "type": "selector", "outbounds": [ "🔴 全球拦截", "🎯 本地直连" ] }, { "tag": "🛑 广告域名", "type": "selector", "outbounds": [ "🔴 全球拦截", "🎯 本地直连" ] },
@@ -39,23 +39,15 @@
{ "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" }, { "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" },
{ "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" }, { "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" },
{ "rule_set": [ "networktest" ], "outbound": "📈 网络测试" }, { "rule_set": [ "networktest" ], "outbound": "📈 网络测试" },
{ "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" }, { "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" },
{ "rule_set": [ "cn" ], "outbound": "🛡️ 直连域名" }, { "rule_set": [ "cn" ], "outbound": "🇨🇳 国内域名" },
{ "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" }, { "ip_is_private": true, "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" }, { "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
{ "rule_set": [ "cnip" ], "outbound": "🀄️ 直连 IP" } { "rule_set": [ "cnip" ], "outbound": "🀄️ 国内 IP" }
], ],
"rule_set": [ "rule_set": [
{
"tag": "private",
"type": "remote",
"format": "binary",
"path": "./ruleset/private.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/private.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "ads", "tag": "ads",
"type": "remote", "type": "remote",
@@ -64,6 +56,14 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/ads.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/ads.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "private",
"type": "remote",
"format": "binary",
"path": "./ruleset/private.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/private.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "trackerslist", "tag": "trackerslist",
"type": "remote", "type": "remote",
@@ -137,11 +137,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "privateip", "tag": "telegramip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/privateip.srs", "path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
@@ -151,14 +151,6 @@
"path": "./ruleset/cnip.srs", "path": "./ruleset/cnip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
},
{
"tag": "telegramip",
"type": "remote",
"format": "binary",
"path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
} }
], ],
"final": "🐟 漏网之鱼" "final": "🐟 漏网之鱼"

View File

@@ -3,15 +3,15 @@
"outbounds": [ "outbounds": [
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] }, { "tag": "🚀 节点选择", "type": "selector", "outbounds": [ "♻️ 自动选择", "👉 手动选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", "🎯 本地直连", {providers_tags} ] },
{ "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📈 网络测试", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点" ] }, { "tag": "🤖 AI 平台", "type": "selector", "outbounds": [ "🚀 节点选择", "👑 高级节点", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "📋 Trackerslist", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] }, { "tag": "🎮 游戏服务", "type": "selector", "outbounds": [ "🎯 本地直连", "👑 高级节点", "🚀 节点选择" ] },
{ "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🪟 微软服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇬 谷歌服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🍎 苹果服务", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🛡️ 直连域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🇨🇳 国内域名", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🀄️ 直连 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] }, { "tag": "🀄️ 国内 IP", "type": "selector", "outbounds": [ "🎯 本地直连", "🚀 节点选择" ] },
{ "tag": "🧱 代理域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] }, { "tag": "🌎 国外域名", "type": "selector", "outbounds": [ "🚀 节点选择", "🎯 本地直连" ] },
{ "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] }, { "tag": "📲 电报消息", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags} ] },
{ "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] }, { "tag": "🐟 漏网之鱼", "type": "selector", "outbounds": [ "🚀 节点选择", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇯🇵 日本节点", "🇸🇬 新加坡节点", "🇺🇸 美国节点", "👑 高级节点", "📉 省流节点", {providers_tags}, "🎯 本地直连" ] },
{ "tag": "🎯 本地直连", "type": "direct" }, { "tag": "🎯 本地直连", "type": "direct" },
@@ -36,13 +36,13 @@
{ "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" }, { "rule_set": [ "games-cn" ], "outbound": "🎮 游戏服务" },
{ "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" }, { "rule_set": [ "ai" ], "outbound": "🤖 AI 平台" },
{ "rule_set": [ "networktest" ], "outbound": "📈 网络测试" }, { "rule_set": [ "networktest" ], "outbound": "📈 网络测试" },
{ "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" }, { "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" },
{ "rule_set": [ "cn" ], "outbound": "🛡️ 直连域名" }, { "rule_set": [ "cn" ], "outbound": "🇨🇳 国内域名" },
{ "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" }, { "ip_is_private": true, "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" }, { "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
{ "rule_set": [ "cnip" ], "outbound": "🀄️ 直连 IP" } { "rule_set": [ "cnip" ], "outbound": "🀄️ 国内 IP" }
], ],
"rule_set": [ "rule_set": [
@@ -127,11 +127,11 @@
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
"tag": "privateip", "tag": "telegramip",
"type": "remote", "type": "remote",
"format": "binary", "format": "binary",
"path": "./ruleset/privateip.srs", "path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{ {
@@ -141,14 +141,6 @@
"path": "./ruleset/cnip.srs", "path": "./ruleset/cnip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
},
{
"tag": "telegramip",
"type": "remote",
"format": "binary",
"path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
} }
], ],
"final": "🐟 漏网之鱼" "final": "🐟 漏网之鱼"

View File

@@ -77,7 +77,6 @@
{ "rule_set": ["telegramip"], "outbound": "📲 电报消息" }, { "rule_set": ["telegramip"], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4" }, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4" },
{ "rule_set": ["gamesip"], "outbound": "🎮 外服游戏" },
{ "rule_set": ["mediaip"], "outbound": "🌍 国际媒体" }, { "rule_set": ["mediaip"], "outbound": "🌍 国际媒体" },
{ "rule_set": ["cnip"], "outbound": "🀄️ 国内流量" } { "rule_set": ["cnip"], "outbound": "🀄️ 国内流量" }
], ],
@@ -242,14 +241,6 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@refs/heads/sing-box-ruleset/telegramip.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@refs/heads/sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "gamesip",
"type": "remote",
"format": "binary",
"path": "./ruleset/gamesip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@refs/heads/sing-box-ruleset/gamesip.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "mediaip", "tag": "mediaip",
"type": "remote", "type": "remote",

View File

@@ -6,7 +6,7 @@
], ],
"route": { "route": {
"rules": [ "rules": [
{ "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" }, { "ip_is_private": true, "outbound": "🎯 本地直连" },
{ "rule_set": [ "cn" ], "outbound": "🎯 本地直连" }, { "rule_set": [ "cn" ], "outbound": "🎯 本地直连" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true}, { "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
@@ -21,14 +21,6 @@
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cn.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cn.srs",
"download_detour": "DIRECT" "download_detour": "DIRECT"
}, },
{
"tag": "privateip",
"type": "remote",
"format": "binary",
"path": "./ruleset/privateip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs",
"download_detour": "DIRECT"
},
{ {
"tag": "cnip", "tag": "cnip",
"type": "remote", "type": "remote",

View File

@@ -81,11 +81,8 @@ done
setconfig versionsh_l $version setconfig versionsh_l $version
#生成用于执行启动服务的变量文件 #生成用于执行启动服务的变量文件
[ ! -f "$CRASHDIR"/configs/command.env ] && { [ ! -f "$CRASHDIR"/configs/command.env ] && {
TMPDIR='/tmp/ShellCrash' echo 'TMPDIR=/tmp/ShellCrash' > "$CRASHDIR"/configs/command.env
BINDIR="$CRASHDIR" echo "BINDIR=$CRASHDIR" >> "$CRASHDIR"/configs/command.env
touch "$CRASHDIR"/configs/command.env
setconfig TMPDIR "$TMPDIR" "$CRASHDIR"/configs/command.env
setconfig BINDIR "$BINDIR" "$CRASHDIR"/configs/command.env
} }
if [ -n "$(grep 'crashcore=singbox' "$CFG_PATH")" ]; then if [ -n "$(grep 'crashcore=singbox' "$CFG_PATH")" ]; then
COMMAND='"$TMPDIR/CrashCore run -D $BINDIR -C $TMPDIR/jsons"' COMMAND='"$TMPDIR/CrashCore run -D $BINDIR -C $TMPDIR/jsons"'

View File

@@ -24,7 +24,7 @@ SET_SNIFFER_CORE_SWITCH="已自动切换至Meta内核域名嗅探需要"
SET_SNIFFER_LOCKED="当前内核与DNS模式组合下域名嗅探无法关闭" SET_SNIFFER_LOCKED="当前内核与DNS模式组合下域名嗅探无法关闭"
SET_CORE_RUNNING="检测到服务正在运行,需要先停止服务!" SET_CORE_RUNNING="检测到服务正在运行,需要先停止服务!"
SET_CORE_STOP_CONFIRM="是否确认停止服务" SET_CORE_STOP_CONFIRM="是否确认停止服务"
# ================================================= # =================================================
# Backup / Restore / Reset # Backup / Restore / Reset

View File

@@ -0,0 +1,6 @@
# 推荐任务配置
TASK_RECOM_TITLE="是否启用以下推荐的自动任务配置:"
TASK_RECOM_ITEM_1="运行时每10分钟自动保存面板配置"
TASK_RECOM_ITEM_2="服务启动后自动同步 NTP 时间"
TASK_RECOM_ITEM_3="在每日的3点0分重启服务"

View File

@@ -1,6 +1,7 @@
COMMON_INPUT="请输入对应数字" COMMON_INPUT="请输入对应数字"
COMMON_INPUT_L="请输入对应字母或数字" COMMON_INPUT_L="请输入对应字母或数字"
COMMON_INPUT_R="是否启用?(1/0) > "
COMMON_BACK="返回上级菜单" COMMON_BACK="返回上级菜单"
COMMON_SUCCESS="操作成功!" COMMON_SUCCESS="操作成功!"
COMMON_FAILED="操作失败!" COMMON_FAILED="操作失败!"

View File

@@ -2,9 +2,9 @@
DNS_CURRENT_MODE="当前DNS运行模式为" DNS_CURRENT_MODE="当前DNS运行模式为"
DNS_RESTART_NOTICE="切换模式后需要手动重启服务以生效!" DNS_RESTART_NOTICE="切换模式后需要手动重启服务以生效!"
DNS_MODE_MIX_DESC="CN域名real-ip其它fake-ip分流" DNS_MODE_MIX_DESC="CN域名DIRECT-DNS其它fake-ip"
DNS_MODE_ROUTE_DESC="CN域名real-ip其它dns2proxy分流" DNS_MODE_ROUTE_DESC="CN域名DIRECT-DNS其它PROXY-DNS"
DNS_MODE_REDIR_DESC="不安全,需搭配第三方DNS服务使用" DNS_MODE_REDIR_DESC="建议搭配加密/第三方DNS服务使用"
DNS_MENU_PROTECT="DNS防泄漏" DNS_MENU_PROTECT="DNS防泄漏"
DNS_MENU_HOSTS="Hosts优化" DNS_MENU_HOSTS="Hosts优化"

View File

@@ -1,6 +1,6 @@
# ===== 通用提示 ===== # ===== 通用提示 =====
MENU_RESTART_NOTICE="检测到配置变更,是否立即重启服务以应用新配置" MENU_RESTART_NOTICE="检测到配置变更,是否立即重启服务以应用新配置"
MENU_PORT_CONFLICT_TITLE="检测到端口被以下进程占用!内核可能无法正常启动!" MENU_PORT_CONFLICT_TITLE="检测到端口被以下进程占用!内核可能无法正常启动!"
MENU_PORT_CONFLICT_HINT="请修改默认端口配置!" MENU_PORT_CONFLICT_HINT="请修改默认端口配置!"
@@ -12,7 +12,7 @@ MENU_CORE_REMOVED="内核文件已移除,请认真检查后重新上传!"
MENU_CFG_LOADED_OK="配置文件加载完成!" MENU_CFG_LOADED_OK="配置文件加载完成!"
MENU_OVERRIDE_WARN="你已经禁用了配置文件覆写功能,这会导致大量脚本功能无法使用!" MENU_OVERRIDE_WARN="你已经禁用了配置文件覆写功能,这会导致大量脚本功能无法使用!"
MENU_OVERRIDE_ASK="是否取消禁用" MENU_OVERRIDE_ASK="是否取消禁用"
# ===== 欢迎与状态 ===== # ===== 欢迎与状态 =====
MENU_WELCOME="欢迎使用ShellCrash" MENU_WELCOME="欢迎使用ShellCrash"
@@ -36,10 +36,10 @@ MENU_TG_CHANNEL="TG频道"
# ===== /tmp 文件检测 ===== # ===== /tmp 文件检测 =====
MENU_TMP_CORE_FOUND="发现可用的内核文件:" MENU_TMP_CORE_FOUND="发现可用的内核文件:"
MENU_TMP_CORE_ASK="是否立即加载该内核(会停止当前服务)" MENU_TMP_CORE_ASK="是否立即加载该内核(会停止当前服务)"
MENU_TMP_CFG_FOUND="发现内核配置文件:" MENU_TMP_CFG_FOUND="发现内核配置文件:"
MENU_TMP_CFG_ASK="是否立即加载为配置文件" MENU_TMP_CFG_ASK="是否立即加载为配置文件"
MENU_MAIN_1="启动/重启服务" MENU_MAIN_1="启动/重启服务"
MENU_MAIN_2="功能设置" MENU_MAIN_2="功能设置"

View File

@@ -0,0 +1,14 @@
# 新手引导
UG_WELCOME="欢迎使用新手引导!"
UG_CHOOSE_ENV="请先选择你的使用环境:"
UG_TIP_CONFIG="(你之后依然可以在设置中更改各种配置)"
UG_OPTION_1="路由设备配置局域网透明代理"
UG_OPTION_2="Linux设备仅配置本机代理"
UG_OPTION_3="还原之前备份的设置"
UG_RESTORE_OK="脚本设置已还原!请重新启动脚本!"
UG_IP_FORWARD_WARN="检测到你的设备尚未开启ip转发局域网设备将无法正常连接网络是否立即开启"
UG_ENABLE_LOW_MEM="检测到你的安装目录空间不足10M是否开启小闪存模式"
UG_IMPORT_CONFIG="这是运行前的最后一步"
UG_CONFIG_TIP="你必须拥有一份配置文件才能运行服务!"
UG_CONFIG_RES="是否立即导入配置文件?"
UG_FINAL_TIP="很好!现在只需要执行启动就可以愉快的使用了!"

View File

@@ -0,0 +1,6 @@
# Recommended task configuration
TASK_RECOM_TITLE="Enable the following recommended automatic tasks?"
TASK_RECOM_ITEM_1="Save Dashboard select every 10 minutes"
TASK_RECOM_ITEM_2="Synchronize NTP after service startup"
TASK_RECOM_ITEM_3="Daily service restart at 03:00"

View File

@@ -1,6 +1,7 @@
COMMON_INPUT="Please enter a number" COMMON_INPUT="Please enter a number"
COMMON_INPUT_L="Enter a letter or a number" COMMON_INPUT_L="Enter a letter or a number"
COMMON_INPUT_R="Enable? (1/0) > "
COMMON_BACK="Back" COMMON_BACK="Back"
COMMON_SUCCESS="Setup Success!" COMMON_SUCCESS="Setup Success!"
COMMON_FAILED="Setup failed!" COMMON_FAILED="Setup failed!"

View File

@@ -2,9 +2,9 @@
DNS_CURRENT_MODE="Current DNS running mode:" DNS_CURRENT_MODE="Current DNS running mode:"
DNS_RESTART_NOTICE="Changes require a manual service restart to take effect." DNS_RESTART_NOTICE="Changes require a manual service restart to take effect."
DNS_MODE_MIX_DESC="CN domains use real-ip, others use fake-ip routing" DNS_MODE_MIX_DESC="CN domains use DIRECT-DNS, others use fake-ip"
DNS_MODE_ROUTE_DESC="CN domains use real-ip, others use dns2proxy routing" DNS_MODE_ROUTE_DESC="CN domains use DIRECT-DNS, others use PROXY-DNS"
DNS_MODE_REDIR_DESC="Insecure. Must be used with a third-party DNS service." DNS_MODE_REDIR_DESC="All domains use DIRECT-DNS"
DNS_MENU_PROTECT="DNS Leak Protect" DNS_MENU_PROTECT="DNS Leak Protect"
DNS_MENU_HOSTS="Hosts Optimization" DNS_MENU_HOSTS="Hosts Optimization"

View File

@@ -0,0 +1,14 @@
UG_WELCOME="Welcome to User Guide!"
UG_CHOOSE_ENV="Please select your usage environment:"
UG_TIP_CONFIG="(You can still change various settings later)"
UG_OPTION_1="Router: LAN transparent proxy"
UG_OPTION_2="Linux device: local proxy only"
UG_OPTION_3="Restore previous backup settings"
UG_RESTORE_OK="Script settings have been restored! Please restart the script!"
UG_IP_FORWARD_WARN="Your device has not enabled IP forwarding, LAN devices will not connect properly. Enable now?"
UG_ENABLE_LOW_MEM="Your installation directory is less than 10MB, enable low-flash mode?"
UG_IMPORT_CONFIG="Import configuration file? (Last step before running)"
UG_CONFIG_TIP="You must have a configuration file to run the service!"
UG_CONFIG_RES="Importing now? "
UG_FINAL_TIP="Great! Now just start the service to enjoy!"

View File

@@ -3,6 +3,7 @@ check_autostart(){
[ ! -f "$CRASHDIR"/.dis_startup ] && return 0 [ ! -f "$CRASHDIR"/.dis_startup ] && return 0
elif [ -f /etc/rc.common -a "$(cat /proc/1/comm)" = "procd" ]; then elif [ -f /etc/rc.common -a "$(cat /proc/1/comm)" = "procd" ]; then
[ -n "$(find /etc/rc.d -name '*shellcrash')" ] && return 0 [ -n "$(find /etc/rc.d -name '*shellcrash')" ] && return 0
[ ! -f "$CRASHDIR"/.dis_startup ] && return 0
elif ckcmd systemctl; then elif ckcmd systemctl; then
[ "$(systemctl is-enabled shellcrash.service 2>&1)" = enabled ] && return 0 [ "$(systemctl is-enabled shellcrash.service 2>&1)" = enabled ] && return 0
elif grep -q 's6' /proc/1/comm; then elif grep -q 's6' /proc/1/comm; then

View File

@@ -23,7 +23,9 @@ core_unzip() { #$1:需要解压的文件 $2:目标文件名
} }
core_find(){ core_find(){
if [ ! -f "$TMPDIR"/CrashCore ];then if [ ! -f "$TMPDIR"/CrashCore ];then
core_dir=$(find "$BINDIR"/CrashCore.* $find_para 2>/dev/null) [ -n "$(find "$CRASHDIR"/CrashCore.* $find_para 2>/dev/null)" ] && [ "$CRASHDIR" != "$BINDIR" ] &&
mv -f "$CRASHDIR"/CrashCore.* "$BINDIR"/
core_dir=$(find "$BINDIR"/CrashCore.* $find_para 2>/dev/null | head -n 1)
[ -n "$core_dir" ] && core_unzip "$core_dir" CrashCore [ -n "$core_dir" ] && core_unzip "$core_dir" CrashCore
fi fi
} }
@@ -49,7 +51,12 @@ core_check(){
else else
mv -f "$1" "$BINDIR/CrashCore.$zip_type" mv -f "$1" "$BINDIR/CrashCore.$zip_type"
fi fi
if [ "$zip_type" = 'upx' ];then
rm -f "$1" "$TMPDIR"/core_new
ln -sf "$TMPDIR/CrashCore.upx" "$TMPDIR/CrashCore"
else
mv -f "$TMPDIR/core_new" "$TMPDIR/CrashCore" mv -f "$TMPDIR/core_new" "$TMPDIR/CrashCore"
fi
core_v="$v" core_v="$v"
setconfig COMMAND "$COMMAND" "$CRASHDIR"/configs/command.env && . "$CRASHDIR"/configs/command.env setconfig COMMAND "$COMMAND" "$CRASHDIR"/configs/command.env && . "$CRASHDIR"/configs/command.env
setconfig crashcore "$crashcore" setconfig crashcore "$crashcore"
@@ -65,15 +72,18 @@ core_webget(){
[ -z "$zip_type" ] && zip_type='tar.gz' [ -z "$zip_type" ] && zip_type='tar.gz'
get_bin "$TMPDIR/Coretmp.$zip_type" "bin/$crashcore/${target}-linux-${cpucore}.$zip_type" get_bin "$TMPDIR/Coretmp.$zip_type" "bin/$crashcore/${target}-linux-${cpucore}.$zip_type"
else else
zip_type=$(echo "$custcorelink" | grep -oE 'tar.gz$') case "$custcorelink" in
[ -z "$zip_type" ] && zip_type=$(echo "$custcorelink" | grep -oE 'gz$') *.tar.gz) zip_type="tar.gz" ;;
*.gz) zip_type="gz" ;;
*.upx) zip_type="upx" ;;
esac
[ -n "$zip_type" ] && webget "$TMPDIR/Coretmp.$zip_type" "$custcorelink" [ -n "$zip_type" ] && webget "$TMPDIR/Coretmp.$zip_type" "$custcorelink"
fi fi
#校验内核 #校验内核
if [ "$?" = 0 ];then if [ "$?" = 0 ];then
core_check "$TMPDIR/Coretmp.$zip_type" core_check "$TMPDIR/Coretmp.$zip_type"
else else
rm -rf "$TMPDIR/Coretmp.$zip_type" rm -f "$TMPDIR/Coretmp.$zip_type"
return 1 return 1
fi fi
} }

View File

@@ -16,7 +16,7 @@ routing_mark=$((fwmark + 2))
[ -z "$dns_nameserver" ] && { [ -z "$dns_nameserver" ] && {
dns_nameserver='223.5.5.5, 1.2.4.8' dns_nameserver='223.5.5.5, 1.2.4.8'
cat /proc/net/udp | grep -q '0035' && dns_nameserver='127.0.0.1' netstat -ntlup 2>/dev/null | grep -q '127.0.0.1:53' && dns_nameserver='127.0.0.1'
} }
[ -z "$dns_fallback" ] && dns_fallback="1.1.1.1, 8.8.8.8" [ -z "$dns_fallback" ] && dns_fallback="1.1.1.1, 8.8.8.8"
[ -z "$dns_resolver" ] && dns_resolver="223.5.5.5, 2400:3200::1" [ -z "$dns_resolver" ] && dns_resolver="223.5.5.5, 2400:3200::1"

View File

@@ -4,15 +4,16 @@ __IS_LIB_LOGGER=1
#日志工具 #日志工具
. "$CRASHDIR"/libs/web_json.sh . "$CRASHDIR"/libs/web_json.sh
#$1日志内容$2显示颜色$3是否推送 #$1日志内容$2显示颜色$3是否推送$4是否覆盖上一条
logger() { logger() {
TMPDIR=/tmp/ShellCrash TMPDIR=/tmp/ShellCrash
[ -n "$2" -a "$2" != 0 ] && printf "\033[%sm%s\033[0m\n" "$2" "$1" [ -n "$2" -a "$2" != 0 ] && printf "\033[%sm%s\033[0m\n" "$2" "$1"
log_text="$(date "+%G-%m-%d_%H:%M:%S")~$1" log_text="$(date "+%G-%m-%d_%H:%M:%S")~$1"
[ "$4" = on ] && sed -i "/$1/d" "$TMPDIR"/ShellCrash.log
echo "$log_text" >>"$TMPDIR"/ShellCrash.log echo "$log_text" >>"$TMPDIR"/ShellCrash.log
[ "$(wc -l "$TMPDIR"/ShellCrash.log | awk '{print $1}')" -gt 199 ] && sed -i '1,20d' "$TMPDIR"/ShellCrash.log [ "$(wc -l "$TMPDIR"/ShellCrash.log | awk '{print $1}')" -gt 199 ] && sed -i '1,20d' "$TMPDIR"/ShellCrash.log
#推送远程日志 #推送远程日志
[ -z "$3" ] && { [ "$3" != off ] && {
[ -n "$device_name" ] && log_text="$log_text($device_name)" [ -n "$device_name" ] && log_text="$log_text($device_name)"
[ -n "$push_TG" ] && { [ -n "$push_TG" ] && {
url="https://api.telegram.org/bot${push_TG}/sendMessage" url="https://api.telegram.org/bot${push_TG}/sendMessage"

View File

@@ -1,27 +1,39 @@
crondir="$(crond -h 2>&1 | grep -oE 'Default:.*' | awk -F ":" '{print $2}')" crondir="$(crond -h 2>&1 | grep -oE 'Default:.*' | awk -F ":" '{print $2}'| tr -d ' ')"
[ ! -w "$crondir" ] && crondir="/etc/storage/cron/crontabs" [ ! -w "$crondir" ] && crondir="/etc/storage/cron/crontabs"
[ ! -w "$crondir" ] && crondir="/var/spool/cron/crontabs" [ ! -w "$crondir" ] && crondir="/var/spool/cron/crontabs"
[ ! -w "$crondir" ] && crondir="/var/spool/cron" [ ! -w "$crondir" ] && crondir="/var/spool/cron"
tmpcron="$TMPDIR"/cron_tmp [ -z "$USER" ] && USER=$(whoami 2>/dev/null)
tmpcron=/tmp/cron_tmp
touch "$tmpcron"
croncmd() { #定时任务工具 cronadd() { #定时任务工具
if [ -n "$(crontab -h 2>&1 | grep '\-l')" ]; then if crontab -h 2>&1 | grep -q '\-l'; then
crontab "$1" crontab "$1"
elif [ -w "$crondir" ] && [ -n "$USER" ];then elif [ -f "$crondir/$USER" ];then
[ "$1" = "-l" ] && cat "$crondir"/"$USER" 2>/dev/null cat "$1" >"$crondir"/"$USER" && cru a REFRESH "0 0 1 1 * /bin/true" 2>/dev/null
[ -f "$1" ] && cat "$1" >"$crondir"/"$USER"
killall -HUP crond 2>/dev/null
else else
echo "找不到可用的crond或者crontab应用No available crond or crontab application can be found!" echo "找不到可用的crond或者crontab应用No available crond or crontab application can be found!"
fi fi
} }
cronload() { #定时任务工具
if crontab -h 2>&1 | grep -q '\-l'; then
crontab -l
elif [ -f "$crondir/$USER" ];then
cat "$crondir"/"$USER" 2>/dev/null
else
return 1
fi
}
cronset() { #定时任务设置 cronset() { #定时任务设置
# 参数1代表要移除的关键字,参数2代表要添加的任务语句 # 参数1代表要移除的关键字,参数2代表要添加的任务语句
croncmd -l >"$tmpcron" cronload | grep -v '^$' | grep -vF "$1" >"$tmpcron"
sed -i "/$1/d" "$tmpcron" [ -n "$2" ] && echo "$2" >>"$tmpcron"
sed -i '/^$/d' "$tmpcron" cronadd "$tmpcron"
echo "$2" >>"$tmpcron" #华硕/Padavan固件存档在本地,其他则删除
croncmd "$tmpcron" if [ -d /jffs ] || [ -d /etc/storage/ShellCrash ];then
mv -f "$tmpcron" "$CRASHDIR"/task/cron
else
rm -f "$tmpcron" rm -f "$tmpcron"
fi
} }

View File

@@ -5,4 +5,5 @@ set_profile() {
echo "alias ${my_alias}=\"$shtype $CRASHDIR/menu.sh\"" >>"$1" #设置快捷命令环境变量 echo "alias ${my_alias}=\"$shtype $CRASHDIR/menu.sh\"" >>"$1" #设置快捷命令环境变量
sed -i '/export CRASHDIR=*/'d "$1" sed -i '/export CRASHDIR=*/'d "$1"
echo "export CRASHDIR=\"$CRASHDIR\"" >>"$1" #设置路径环境变量 echo "export CRASHDIR=\"$CRASHDIR\"" >>"$1" #设置路径环境变量
. "$1" >/dev/null 2>&1 || true
} }

View File

@@ -2,7 +2,7 @@
webget(){ webget(){
if pidof CrashCore >/dev/null; then if pidof CrashCore >/dev/null; then
setproxy #设置临时代理 setproxy #设置临时代理,【$1】代表下载目录【$2】代表在线地址
url=$(printf '%s\n' "$2" | url=$(printf '%s\n' "$2" |
sed -e 's#https://.*jsdelivr.net/gh/juewuy/ShellCrash[@|/]#https://raw.githubusercontent.com/juewuy/ShellCrash/#' \ sed -e 's#https://.*jsdelivr.net/gh/juewuy/ShellCrash[@|/]#https://raw.githubusercontent.com/juewuy/ShellCrash/#' \
-e 's#https://gh.jwsc.eu.org/#https://raw.githubusercontent.com/juewuy/ShellCrash/#') -e 's#https://gh.jwsc.eu.org/#https://raw.githubusercontent.com/juewuy/ShellCrash/#')
@@ -10,31 +10,59 @@ webget(){
url=$(printf '%s\n' "$2" | url=$(printf '%s\n' "$2" |
sed 's#https://raw.githubusercontent.com/juewuy/ShellCrash/#https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@#') sed 's#https://raw.githubusercontent.com/juewuy/ShellCrash/#https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@#')
fi fi
# ===============================================
#参数【$1】代表下载目录【$2】代表在线地址 #参数【$1】代表下载目录【$2】代表在线地址
#参数【$3】代表输出显示【$4】不启用重定向 #参数【$3】代表输出显示【$4】不启用重定向
#参数【$5】代表验证证书【$6】使用自定义UA #参数【$5】代表验证证书【$6】使用自定义UA
[ -n "$6" ] && agent="--user-agent \"$6\"" [ -n "$6" ] && agent="--user-agent $6"
if wget --help 2>&1 | grep -q 'show-progress' >/dev/null 2>&1; then if wget --help 2>&1 | grep -q 'show-progress' >/dev/null 2>&1; then
[ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress' [ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress'
[ "$4" = "rediroff" ] && redirect='--max-redirect=0' || redirect='' [ "$4" = "rediroff" ] && redirect='--max-redirect=0' || redirect=''
[ "$5" = "skipceroff" ] && certificate='' || certificate='--no-check-certificate' if [ "$5" = "skipceroff" ] || [ "$skip_cert" = OFF ];then
certificate=''
else
certificate='--no-check-certificate'
fi
wget -Y on $agent $progress $redirect $certificate --timeout=3 -O "$1" "$url" && return 0 #成功则退出否则重试 wget -Y on $agent $progress $redirect $certificate --timeout=3 -O "$1" "$url" && return 0 #成功则退出否则重试
wget -Y off $agent $progress $redirect $certificate --timeout=5 -O "$1" "$2" wget -Y off $agent $progress $redirect $certificate --timeout=5 -O "$1" "$2"
return $? return $?
elif curl --version >/dev/null 2>&1; then elif curl --version >/dev/null 2>&1; then
[ "$3" = "echooff" ] && progress='-s' || progress='-#' if [ "$3" = "echooff" ];then
progress='-s'
elif echo "$url" | grep -q 'jsdelivr.net';then
progress='-#'
. "$CRASHDIR"/libs/web_get_curlbar.sh && curl_fsize
else
progress='-#'
fi
[ "$4" = "rediroff" ] && redirect='' || redirect='-L' [ "$4" = "rediroff" ] && redirect='' || redirect='-L'
[ "$5" = "skipceroff" ] && certificate='' || certificate='-k' if [ "$5" = "skipceroff" ] || [ "$skip_cert" = OFF ];then
certificate=''
else
certificate='-k'
fi
# curl 特殊版本兼容
auth_arg=""
if curl --version | grep -q '^curl 8.' && ckcmd base64; then if curl --version | grep -q '^curl 8.' && ckcmd base64; then
auth_b64=$(printf '%s' "$authentication" | base64) auth_b64=$(printf '%s' "$authentication" | base64)
result=$(curl $agent -w '%{http_code}' --connect-timeout 3 --proxy-header "Proxy-Authorization: Basic $auth_b64" $progress $redirect $certificate -o "$1" "$url") [ -n "$auth_b64" ] && auth_arg="--proxy-header Proxy-Authorization:Basic $auth_b64"
else
result=$(curl $agent -w '%{http_code}' --connect-timeout 3 $progress $redirect $certificate -o "$1" "$url")
fi fi
if [ -n "$fsize_raw" ] && [ "$fsize_raw" -gt 204800 ]; then
result=$(execute_curl "$1" "$url" "$fsize_raw" "$agent $auth_arg $redirect $certificate")
else
result=$(curl $agent $auth_arg -w '%{http_code}' --connect-timeout 3 $progress $redirect $certificate -o "$1" "$url")
fi
[ "$result" = "200" ] && return 0 #成功则退出否则重试 [ "$result" = "200" ] && return 0 #成功则退出否则重试
export https_proxy="" export https_proxy=""
export http_proxy="" export http_proxy=""
if [ -n "$fsize_raw" ] && [ "$fsize_raw" -gt 204800 ]; then
result=$(execute_curl "$1" "$2" "$fsize_raw" "$agent $redirect $certificate")
else
result=$(curl $agent -w '%{http_code}' --connect-timeout 5 $progress $redirect $certificate -o "$1" "$2") result=$(curl $agent -w '%{http_code}' --connect-timeout 5 $progress $redirect $certificate -o "$1" "$2")
fi
[ "$result" = "200" ] [ "$result" = "200" ]
return $? return $?
elif ckcmd wget;then elif ckcmd wget;then

View File

@@ -0,0 +1,47 @@
bar_max=42 #进度条长度
curl_fsize(){ # 获取文件大小
fsize_raw=0
header=$(curl -sIL --connect-timeout 2 "$url")
# 代理容错
[ -z "$header" ] && { export https_proxy=""; export http_proxy=""; header=$(curl -sIL --connect-timeout 2 "$url"); }
# 提取大小 (优先 Content-Length其次 ETag)
fsize_raw=$(echo "$header" | grep -i 'Content-Length' | tail -n 1 | awk '{print $2}' | tr -d '\r' | awk '{print int($1)}')
if [ -z "$fsize_raw" ] || [ "$fsize_raw" -eq 0 ]; then
etag=$(echo "$header" | grep -i 'etag' | tail -n 1 | cut -d '"' -f2 | cut -d '-' -f1)
[ -n "$etag" ] && fsize_raw=$(printf "%d" 0x$etag 2>/dev/null)
fi
}
execute_curl(){ # 手搓curl进度条
local path="$1" target_url="$2" total_size="$3" extra_args="$4"
rm -f /tmp/webget_res
# 后台静默下载,状态码写入临时文件
curl $extra_args -s -L -w '%{http_code}' "$target_url" -o "$path" > /tmp/webget_res &
local pid=$!
# 循环监控
while kill -0 $pid 2>/dev/null; do
if [ -f "$path" ]; then
local curr=$(wc -c < "$path")
local pct=$(awk -v c=$curr -v t=$total_size 'BEGIN {p=(c*100/t); if(p>100)p=100; printf "%.1f", p}')
local num=$(awk -v p=$pct -v w=$bar_max 'BEGIN {printf "%d", p*w/100}')
local bar=$(printf "%${num}s" | tr ' ' '#'); local spc_n=$((bar_max - num))
local spc=""; [ "$spc_n" -gt 0 ] && spc=$(printf "%${spc_n}s")
local size=$(( fsize_raw * 100 / 1048576 ))
local fs="$((size / 100)).$((size % 100)) MB"
printf "\r\033[2K%s%s %6s%%(%s)" "$bar" "$spc" "$pct" "$fs" >&2
fi
usleep 200000 2>/dev/null || sleep 1
done
local code=$(cat /tmp/webget_res 2>/dev/null)
if [ "$code" = "200" ] || [ "$code" = "206" ]; then
local full=$(printf "%${bar_max}s" | tr ' ' '#')
printf "\r\033[2K%s 100.0%%(%s)\n" "$full" "$fs" >&2
else
printf "\r\033[2K" >&2; [ -f "$path" ] && rm -f "$path"
fi
echo "$code"
}

View File

@@ -32,13 +32,9 @@ load_lang common
load_lang menu load_lang menu
checkrestart() { checkrestart() {
line_break comp_box "\033[32m$MENU_RESTART_NOTICE\033[0m"
separator_line "=" btm_box "1) 立即重启" \
content_line "\033[32m$MENU_RESTART_NOTICE\033[0m" "0) 暂不重启"
separator_line "="
content_line "1) 立即重启"
content_line "0) 暂不重启"
separator_line "="
read -r -p "$COMMON_INPUT> " res read -r -p "$COMMON_INPUT> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
start_service start_service
@@ -59,12 +55,10 @@ checkport() {
conflict_line=$(echo "$current_listening" | grep ":$portx ") conflict_line=$(echo "$current_listening" | grep ":$portx ")
if [ -n "$conflict_line" ]; then if [ -n "$conflict_line" ]; then
line_break
separator_line "=" comp_box "$portx】:$MENU_PORT_CONFLICT_TITLE" \
content_line "$portx】:$MENU_PORT_CONFLICT_TITLE" "\033[0m$(echo "$conflict_line" | head -n 1)\033[0m" \
content_line "\033[0m$(echo "$conflict_line" | head -n 1)\033[0m" "\033[36m$MENU_PORT_CONFLICT_HINT\033[0m"
content_line "\033[36m$MENU_PORT_CONFLICT_HINT\033[0m"
separator_line "="
. "$CRASHDIR"/menus/2_settings.sh && set_adv_config . "$CRASHDIR"/menus/2_settings.sh && set_adv_config
. "$CRASHDIR"/libs/get_config.sh . "$CRASHDIR"/libs/get_config.sh
@@ -86,7 +80,6 @@ checkport() {
# 脚本启动前检查 # 脚本启动前检查
ckstatus() { ckstatus() {
versionsh=$(cat "$CRASHDIR"/version) versionsh=$(cat "$CRASHDIR"/version)
[ -n "$versionsh" ] && versionsh_l=$versionsh [ -n "$versionsh" ] && versionsh_l=$versionsh
[ -z "$redir_mod" ] && redir_mod="$MENU_PURE_MOD" [ -z "$redir_mod" ] && redir_mod="$MENU_PURE_MOD"
@@ -132,65 +125,41 @@ ckstatus() {
userguide=1 userguide=1
. "$CRASHDIR"/menus/userguide.sh && userguide . "$CRASHDIR"/menus/userguide.sh && userguide
setconfig userguide 1 setconfig userguide 1
. "$CRASHDIR"/configs/ShellCrash.cfg
fi fi
# 检查执行权限 # 检查执行权限
[ ! -x "$CRASHDIR"/start.sh ] && chmod +x "$CRASHDIR"/start.sh [ ! -x "$CRASHDIR"/start.sh ] && chmod +x "$CRASHDIR"/start.sh
line_break
separator_line "="
content_line "\033[30;43m$MENU_WELCOME\033[0m"
content_right "Ver: $versionsh_l"
content_line "$MENU_TG_CHANNEL\033[36;4mhttps://t.me/ShellClash\033[0m"
separator_line "-"
content_line "$corename$run\t $auto"
if [ -n "$PID" ]; then
content_line "$MENU_MEM_USED\033[44m$VmRSS\033[0m\t $MENU_RUNNING_TIME\033[46;30m$day\033[44;37m$time\033[0m"
fi
separator_line "="
# 检查/tmp内核文件 # 检查/tmp内核文件
for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -Ev ".*(zip|7z|tar)$" | grep -iE 'CrashCore|^clash$|^clash-linux.*|^mihomo.*|^sing.*box'); do for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -Ev ".*(zip|7z|tar)$" | grep -iE 'CrashCore|^clash$|^clash-linux.*|^mihomo.*|^sing.*box'); do
line_break comp_box "$MENU_TMP_CORE_FOUND \033[36m/tmp/$file\033[0m" \
separator_line "=" "$MENU_TMP_CORE_ASK"
content_line "$MENU_TMP_CORE_FOUND \033[36m/tmp/$file\033[0m" btm_box "1) 立即加载" \
content_line "$MENU_TMP_CORE_ASK" "0) 暂不加载"
separator_line "="
content_line "1) 立即加载"
content_line "0) 暂不加载"
separator_line "="
read -r -p "$COMMON_INPUT> " res read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
line_break
separator_line "="
zip_type=$(echo "$file" | grep -oE 'tar.gz$|upx$|gz$') zip_type=$(echo "$file" | grep -oE 'tar.gz$|upx$|gz$')
. "$CRASHDIR"/menus/9_upgrade.sh && setcoretype . "$CRASHDIR"/menus/9_upgrade.sh && setcoretype
. "$CRASHDIR"/libs/core_tools.sh && core_check "/tmp/$file" . "$CRASHDIR"/libs/core_tools.sh && core_check "/tmp/$file"
if [ "$?" = 0 ]; then if [ "$?" = 0 ]; then
content_line "\033[32m$MENU_CORE_LOADED_OK\033[0m" msg_alert "\033[32m$MENU_CORE_LOADED_OK\033[0m"
separator_line "="
switch_core switch_core
else else
content_line "\033[33m$MENU_CORE_LOADED_BAD\033[0m"
rm -rf /tmp/"$file" rm -rf /tmp/"$file"
content_line "\033[33m$MENU_CORE_REMOVED\033[0m" msg_alert "\033[33m$MENU_CORE_LOADED_BAD\033[0m" \
"\033[33m$MENU_CORE_REMOVED\033[0m"
fi fi
separator_line "="
sleep 1
} }
done done
# 检查/tmp配置文件 # 检查/tmp配置文件
for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -iE 'config.yaml$|config.yml$|config.json$'); do for file in $(ls /tmp | grep -v [/$] | grep -v ' ' | grep -iE 'config.yaml$|config.yml$|config.json$'); do
tmp_file=/tmp/$file tmp_file=/tmp/$file
line_break comp_box "$MENU_TMP_CFG_FOUND\033[36m/tmp/$file\033[0m" \
separator_line "=" "$MENU_TMP_CFG_ASK"
content_line "$MENU_TMP_CFG_FOUND \033[36m/tmp/$file\033[0m" btm_box "1) 立即加载" \
content_line "$MENU_TMP_CFG_ASK" "0) 暂不加载"
separator_line "="
content_line "1) 立即加载"
content_line "0) 暂不加载"
separator_line "="
read -p "$COMMON_INPUT> " res read -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
if [ -n "$(echo /tmp/$file | grep -iE '.json$')" ]; then if [ -n "$(echo /tmp/$file | grep -iE '.json$')" ]; then
@@ -198,44 +167,45 @@ ckstatus() {
else else
mv -f /tmp/$file "$CRASHDIR"/yamls/config.yaml mv -f /tmp/$file "$CRASHDIR"/yamls/config.yaml
fi fi
line_break msg_alert "\033[32m$MENU_CFG_LOADED_OK\033[0m "
separator_line "="
content_line "\033[32m$MENU_CFG_LOADED_OK\033[0m "
separator_line "="
sleep 1
} }
done done
# 检查禁用配置覆写 # 检查禁用配置覆写
[ "$disoverride" = "1" ] && { [ "$disoverride" = "1" ] && {
line_break comp_box "\033[33m$MENU_OVERRIDE_WARN\033[0m" \
separator_line "=" "$MENU_OVERRIDE_ASK"
content_line "\033[33m$MENU_OVERRIDE_WARN\033[0m" btm_box "1) 是" \
content_line "$MENU_OVERRIDE_ASK" "0) 否"
separator_line "="
content_line "1) 是"
content_line "0) 否"
separator_line "="
read -p "$COMMON_INPUT> " res read -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && unset disoverride && setconfig disoverride [ "$res" = 1 ] && unset disoverride && setconfig disoverride
} }
top_box "\033[30;43m$MENU_WELCOME\033[0m\t\t Ver: $versionsh_l" \
"$MENU_TG_CHANNEL\033[36;4mhttps://t.me/ShellClash\033[0m"
separator_line "-"
content_line "$corename$run\t $auto"
if [ -n "$PID" ]; then
content_line "$MENU_MEM_USED\033[44m$VmRSS\033[0m\t $MENU_RUNNING_TIME\033[46;30m$day\033[44;37m$time\033[0m"
fi
separator_line "="
} }
main_menu() { main_menu() {
while true; do while true; do
ckstatus ckstatus
content_line "1) \033[32m$MENU_MAIN_1\033[0m" btm_box "1) \033[32m$MENU_MAIN_1\033[0m"\
content_line "2) \033[36m$MENU_MAIN_2\033[0m" "2) \033[36m$MENU_MAIN_2\033[0m"\
content_line "3) \033[31m$MENU_MAIN_3\033[0m" "3) \033[31m$MENU_MAIN_3\033[0m"\
content_line "4) \033[33m$MENU_MAIN_4\033[0m" "4) \033[33m$MENU_MAIN_4\033[0m"\
content_line "5) \033[32m$MENU_MAIN_5\033[0m" "5) \033[32m$MENU_MAIN_5\033[0m"\
content_line "6) \033[36m$MENU_MAIN_6\033[0m" "6) \033[36m$MENU_MAIN_6\033[0m"\
content_line "7) \033[33m$MENU_MAIN_7\033[0m" "7) \033[33m$MENU_MAIN_7\033[0m"\
content_line "8) $MENU_MAIN_8" "8) $MENU_MAIN_8"\
content_line "9) \033[32m$MENU_MAIN_9\033[0m" "9) \033[32m$MENU_MAIN_9\033[0m"\
content_line "0) $MENU_MAIN_0" ""\
separator_line "=" "0) $MENU_MAIN_0"
read -r -p "$MENU_MAIN_PROMPT" num read -r -p "$MENU_MAIN_PROMPT" num
case "$num" in case "$num" in
@@ -245,8 +215,8 @@ main_menu() {
;; ;;
1) 1)
start_service start_service
exit
line_break line_break
exit
;; ;;
2) 2)
checkcfg=$(cat "$CFG_PATH") checkcfg=$(cat "$CFG_PATH")
@@ -260,11 +230,7 @@ main_menu() {
[ "$bot_tg_service" = ON ] && . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop [ "$bot_tg_service" = ON ] && . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop
"$CRASHDIR"/start.sh stop "$CRASHDIR"/start.sh stop
sleep 1 sleep 1
line_break msg_alert "\033[31m$corename$MENU_SERVICE_STOPPED\033[0m"
separator_line "="
content_line "\033[31m$corename$MENU_SERVICE_STOPPED\033[0m"
separator_line "="
sleep 1
;; ;;
4) 4)
. "$CRASHDIR"/menus/4_setboot.sh && setboot . "$CRASHDIR"/menus/4_setboot.sh && setboot
@@ -298,7 +264,6 @@ main_menu() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -333,33 +298,26 @@ case "$1" in
;; ;;
-d) -d)
shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash
line_break comp_box "$MENU_TEST_RUNNING_1" \
separator_line "=" "$MENU_TEST_RUNNING_2\033[36;4mhttps://t.me/ShellClash\033[0m"
content_line "$MENU_TEST_RUNNING_1"
content_line "$MENU_TEST_RUNNING_2\033[36;4mhttps://t.me/ShellClash\033[0m"
separator_line "="
"$shtype" "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh_bug.log "$shtype" "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh_bug.log
"$shtype" -x "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh.log "$shtype" -x "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh.log
line_break
cat "$TMPDIR"/debug_sh_bug.log | grep 'start\.sh' >"$TMPDIR"/sh_bug cat "$TMPDIR"/debug_sh_bug.log | grep 'start\.sh' >"$TMPDIR"/sh_bug
if [ -s "$TMPDIR"/sh_bug ]; then if [ -s "$TMPDIR"/sh_bug ]; then
line_break
echo "===========================================================" echo "==========================================================="
while read line; do while read line; do
echo -e "$MENU_ERROR_FOUND\033[33;4m$line\033[0m" echo -e "$MENU_ERROR_FOUND\033[33;4m$line\033[0m"
grep -A 1 -B 3 "$line" "$TMPDIR"/debug_sh.log grep -A 1 -B 3 "$line" "$TMPDIR"/debug_sh.log
echo "===========================================================" echo
done <"$TMPDIR"/sh_bug done <"$TMPDIR"/sh_bug
echo "==========================================================="
rm -rf "$TMPDIR"/sh_bug rm -rf "$TMPDIR"/sh_bug
line_break comp_box "\033[32m$MENU_TEST_DONE_FAIL\033[0m" \
separator_line "=" "$MENU_TEST_LOG_HINT\033[36m$TMPDIR/debug_sh.log\033[0m"
content_line "\033[32m$MENU_TEST_DONE_FAIL\033[0m"
content_line "$MENU_TEST_LOG_HINT\033[36m$TMPDIR/debug_sh.log\033[0m"
separator_line "="
else else
rm -rf "$TMPDIR"/debug_sh.log rm -rf "$TMPDIR"/debug_sh.log
separator_line "=" comp_box "\033[32m$MENU_TEST_DONE_OK\033[0m"
content_line "\033[32m$MENU_TEST_DONE_OK\033[0m"
separator_line "="
line_break line_break
fi fi
"$CRASHDIR"/start.sh stop "$CRASHDIR"/start.sh stop
@@ -368,10 +326,7 @@ case "$1" in
. "$CRASHDIR"/menus/uninstall.sh && uninstall . "$CRASHDIR"/menus/uninstall.sh && uninstall
;; ;;
*) *)
line_break comp_box "$MENU_WELCOME"
separator_line "="
content_line "$MENU_WELCOME"
separator_line "="
content_line "-t $MENU_CLI_TEST" content_line "-t $MENU_CLI_TEST"
content_line "-h $MENU_CLI_HELP" content_line "-h $MENU_CLI_HELP"
content_line "-u $MENU_CLI_UNINSTALL" content_line "-u $MENU_CLI_UNINSTALL"

View File

@@ -7,11 +7,8 @@ load_lang 1_start
# ===== 启动完成提示 ===== # ===== 启动完成提示 =====
startover() { startover() {
line_break top_box "\033[32m$START_SERVICE_OK\033[0m" \
separator_line "=" "$START_WEB_HINT \033[4;36mhttp://$host$hostdir\033[0m"
content_line "\033[32m$START_SERVICE_OK\033[0m"
content_line "$START_WEB_HINT \033[4;36mhttp://$host$hostdir\033[0m"
if [ "$firewall_area" = 4 ]; then if [ "$firewall_area" = 4 ]; then
content_line "" content_line ""
content_line "$START_PAC_HINT \033[4;32mhttp://$host:$db_port/ui/pac\033[0m" content_line "$START_PAC_HINT \033[4;32mhttp://$host:$db_port/ui/pac\033[0m"
@@ -32,17 +29,14 @@ start_core() {
fi fi
if [ ! -s "$core_config" ] && [ -s "$CRASHDIR/configs/providers.cfg" ]; then if [ ! -s "$core_config" ] && [ -s "$CRASHDIR/configs/providers.cfg" ]; then
if [ "$crashcore" = singboxr ];then if [ "$crashcore" = singboxr ]; then
CORE_TYPE=singbox CORE_TYPE=singbox
else else
CORE_TYPE=clash CORE_TYPE=clash
fi fi
. "$CRASHDIR/menus/providers_$CORE_TYPE.sh" && gen_providers . "$CRASHDIR/menus/providers_$CORE_TYPE.sh" && gen_providers
line_break comp_box "\033[33m$START_NO_CORE_CFG_TRY_GEN\033[0m"
separator_line "="
content_line "\033[33m$START_NO_CORE_CFG_TRY_GEN\033[0m"
separator_line "="
elif [ -s "$core_config" ] || [ -n "$Url" ] || [ -n "$Https" ]; then elif [ -s "$core_config" ] || [ -n "$Url" ] || [ -n "$Https" ]; then
"$CRASHDIR/start.sh" start "$CRASHDIR/start.sh" start
@@ -57,10 +51,7 @@ start_core() {
startover startover
} }
else else
line_break comp_box "\033[31m$START_NO_CORE_CFG_IMPORT_FIRST\033[0m"
separator_line "="
content_line "\033[31m$START_NO_CORE_CFG_IMPORT_FIRST\033[0m"
separator_line "="
. "$CRASHDIR/menus/6_core_config.sh" && set_core_config . "$CRASHDIR/menus/6_core_config.sh" && set_core_config
fi fi
} }
@@ -69,10 +60,7 @@ start_core() {
start_service() { start_service() {
if [ "$firewall_area" = 5 ]; then if [ "$firewall_area" = 5 ]; then
"$CRASHDIR/start.sh" start "$CRASHDIR/start.sh" start
line_break comp_box "\033[32m$START_FIREWALL_DONE\033[0m"
separator_line "="
content_line "\033[32m$START_FIREWALL_DONE\033[0m"
separator_line "="
line_break line_break
else else
start_core start_core

View File

@@ -11,13 +11,13 @@ settings() {
while true; do while true; do
# 获取设置默认显示 # 获取设置默认显示
[ -z "$skip_cert" ] && skip_cert=ON [ -z "$skip_cert" ] && skip_cert=ON
[ -z "$sniffer" ] && sniffer=OFF [ -z "$sniffer" ] && {
sniffer=OFF
echo "$crashcore" | grep -q 'singbox' && sniffer=ON
}
[ -z "$dns_mod" ] && dns_mod='redir_host' [ -z "$dns_mod" ] && dns_mod='redir_host'
line_break comp_box "\033[30;47m$SET_MENU_TITLE\033[0m"
separator_line "="
content_line "\033[30;47m$SET_MENU_TITLE\033[0m"
separator_line "="
content_line "1) $SET_MENU_REDIR\t\033[36m$redir_mod$MENU_MOD\033[0m" content_line "1) $SET_MENU_REDIR\t\033[36m$redir_mod$MENU_MOD\033[0m"
content_line "2) $SET_MENU_DNS\t\033[36m$dns_mod\033[0m" content_line "2) $SET_MENU_DNS\t\033[36m$dns_mod\033[0m"
content_line "3) $SET_MENU_FW_FILTER" content_line "3) $SET_MENU_FW_FILTER"
@@ -26,13 +26,13 @@ settings() {
content_line "5) $SET_MENU_SNIFFER\t\033[36m$sniffer\033[0m" content_line "5) $SET_MENU_SNIFFER\t\033[36m$sniffer\033[0m"
content_line "6) $SET_MENU_ADV_PORT" content_line "6) $SET_MENU_ADV_PORT"
} }
content_line "8) $SET_MENU_IPV6\t\033[36m$ipv6_redir\033[0m" content_line "7) $SET_MENU_IPV6\t\033[36m$ipv6_redir\033[0m"
separator_line "-" btm_box "" \
content_line "a) \033[31m$SET_MENU_RESET\033[0m" "a) \033[31m$SET_MENU_RESET\033[0m" \
content_line "b) \033[36m$SET_MENU_LANG\033[0m" "b) \033[36m$SET_MENU_LANG\033[0m" \
content_line "c) \033[33m$SET_MENU_UI\033[0m" "c) \033[33m$SET_MENU_UI\033[0m" \
content_line "0) $COMMON_BACK" "" \
separator_line "=" "0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -40,13 +40,9 @@ settings() {
;; ;;
1) 1)
if [ "$USER" != root ] && [ "$USER" != admin ]; then if [ "$USER" != root ] && [ "$USER" != admin ]; then
line_break comp_box "$SET_WARN_NONROOT"
separator_line "=" btm_box "1) 是" \
content_line "$SET_WARN_NONROOT" "0) 否,返回上级菜单"
separator_line "="
content_line "1) 是"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "$COMMON_INPUT> " res read -r -p "$COMMON_INPUT> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
set_redir_mod set_redir_mod
@@ -67,44 +63,33 @@ settings() {
line_break line_break
separator_line "=" separator_line "="
if [ "$skip_cert" = "OFF" ]; then if [ "$skip_cert" = "OFF" ]; then
content_line "当前\033[33m已禁用\033[0m跳过本地证书验证是否确认启用" content_line "当前\033[33m已禁用\033[0m跳过本地证书验证是否确认启用"
else else
content_line "当前\033[33m已启用\033[0m跳过本地证书验证是否确认禁用" content_line "当前\033[33m已启用\033[0m跳过本地证书验证是否确认禁用"
fi fi
separator_line "=" separator_line "="
content_line "1) 是" btm_box "1) 是" \
content_line "0) 否,返回上级菜单" "0) 否,返回上级菜单"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
if [ "$num" = 1 ]; then if [ "$num" = 1 ]; then
line_break
separator_line "="
if [ "$skip_cert" = OFF ]; then if [ "$skip_cert" = OFF ]; then
skip_cert=ON skip_cert=ON
content_line "\033[33m$SET_SKIP_CERT_ON\033[0m" msg_alert "\033[33m$SET_SKIP_CERT_ON\033[0m"
else else
skip_cert=OFF skip_cert=OFF
content_line "\033[33m$SET_SKIP_CERT_OFF\033[0m" msg_alert "\033[33m$SET_SKIP_CERT_OFF\033[0m"
fi fi
setconfig skip_cert $skip_cert setconfig skip_cert $skip_cert
separator_line "="
else else
continue continue
fi fi
sleep 1
;; ;;
5) 5)
line_break
separator_line "="
if [ "$sniffer" = "OFF" ]; then if [ "$sniffer" = "OFF" ]; then
content_line "当前\033[33m已禁用\033[0m域名嗅探是否确认启用" comp_box "当前\033[33m已禁用\033[0m域名嗅探是否确认启用"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
if [ "$num" = 1 ]; then if [ "$num" = 1 ]; then
line_break line_break
separator_line "=" separator_line "="
@@ -112,25 +97,20 @@ settings() {
rm -rf "$TMPDIR/CrashCore" "$CRASHDIR/CrashCore" "$CRASHDIR/CrashCore.tar.gz" rm -rf "$TMPDIR/CrashCore" "$CRASHDIR/CrashCore" "$CRASHDIR/CrashCore.tar.gz"
crashcore=meta crashcore=meta
setconfig crashcore $crashcore setconfig crashcore $crashcore
line_break top_box "$SET_SNIFFER_CORE_SWITCH" \
content_line "$SET_SNIFFER_CORE_SWITCH" ""
content_line ""
fi fi
sniffer=ON sniffer=ON
else else
continue continue
fi fi
elif [ "$crashcore" = clashpre ] && [ "$dns_mod" = redir_host ]; then elif [ "$crashcore" = clashpre ] && [ "$dns_mod" = redir_host ]; then
content_line "\033[31m$SET_SNIFFER_LOCKED\033[0m" msg_alert "\033[31m$SET_SNIFFER_LOCKED\033[0m"
separator_line "="
sleep 1
continue continue
else else
content_line "当前\033[33m已启用\033[0m域名嗅探是否确认禁用" comp_box "当前\033[33m已启用\033[0m域名嗅探是否确认禁用"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
if [ "$num" = 1 ]; then if [ "$num" = 1 ]; then
sniffer=OFF sniffer=OFF
@@ -141,20 +121,15 @@ settings() {
fi fi
fi fi
setconfig sniffer "$sniffer" setconfig sniffer "$sniffer"
content_line "\033[32m操作成功\033[0m" btm_box "\033[32m操作成功\033[0m"
separator_line "="
sleep 1 sleep 1
;; ;;
6) 6)
if pidof CrashCore >/dev/null; then if pidof CrashCore >/dev/null; then
line_break comp_box "\033[33m$SET_CORE_RUNNING\033[0m" \
separator_line "=" "$SET_CORE_STOP_CONFIRM"
content_line "\033[33m$SET_CORE_RUNNING\033[0m" btm_box "1) 是" \
content_line "$SET_CORE_STOP_CONFIRM" "0) 否,返回上级菜单"
separator_line "="
content_line "1) 是"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "$COMMON_INPUT> " res read -r -p "$COMMON_INPUT> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
"$CRASHDIR/start.sh" stop && set_adv_config "$CRASHDIR/start.sh" stop && set_adv_config
@@ -165,18 +140,16 @@ settings() {
set_adv_config set_adv_config
fi fi
;; ;;
8) 7)
set_ipv6 set_ipv6
;; ;;
a) a)
BACK_TAR="$CRASHDIR/configs.tar.gz" BACK_TAR="$CRASHDIR/configs.tar.gz"
line_break comp_box "1) $SET_BACKUP" \
separator_line "=" "2) $SET_RESTORE" \
content_line "1) $SET_BACKUP" "3) $SET_RESET" \
content_line "2) $SET_RESTORE" "" \
content_line "3) $SET_RESET" "0) $COMMON_BACK"
content_line "0) $COMMON_BACK"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -190,6 +163,7 @@ settings() {
else else
content_line "\033[31m$SET_BACKUP_FAIL\033[0m" content_line "\033[31m$SET_BACKUP_FAIL\033[0m"
fi fi
separator_line "="
sleep 1 sleep 1
continue continue
;; ;;
@@ -218,52 +192,43 @@ settings() {
fi fi
;; ;;
*) *)
errornub errornum
sleep 1
continue continue
;; ;;
esac esac
content_line "\033[33m$SET_NEED_RESTART\033[0m" content_line "\033[33m$SET_NEED_RESTART\033[0m"
separator_line "="
line_break
sleep 1 sleep 1
exit 0 exit 0
;; ;;
b) b)
line_break comp_box "1) 简体中文" \
separator_line "=" "2) English" \
content_line "1) 简体中文" "" \
content_line "2) English" "0) $COMMON_BACK"
content_line "0) $COMMON_BACK"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
continue continue
;; ;;
1) 1)
line_break
separator_line "="
echo chs >"$CRASHDIR"/configs/i18n.cfg echo chs >"$CRASHDIR"/configs/i18n.cfg
content_line "\033[32m切换成功请重新运行脚本\033[0m" msg_alert "\033[32m切换成功请重新运行脚本\033[0m"
;; ;;
2) 2)
line_break
separator_line "="
echo en >"$CRASHDIR"/configs/i18n.cfg echo en >"$CRASHDIR"/configs/i18n.cfg
content_line "\033[32mLanguage switched successfully! Please re-run the script!\033[0m" msg_alert "\033[32mLanguage switched successfully! Please re-run the script!\033[0m"
;; ;;
esac esac
separator_line "="
line_break line_break
sleep 1
exit 0 exit 0
;; ;;
c) c)
line_break comp_box "1) New Design by Sofia-Riese" \
separator_line "=" "2) TUI-lite" \
content_line "1) New Design by Sofia-Riese" "" \
content_line "2) TUI-lite" "0) $COMMON_BACK"
content_line "0) $COMMON_BACK"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -278,15 +243,10 @@ settings() {
. "$CRASHDIR"/menus/tui_lite.sh . "$CRASHDIR"/menus/tui_lite.sh
;; ;;
esac esac
line_break msg_alert "\033[32m切换成功\033[0m"
separator_line "="
content_line "\033[32m切换成功\033[0m"
separator_line "="
sleep 1
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -295,11 +255,7 @@ settings() {
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"
line_break msg_alert "\033[36m$SET_REDIR_APPLIED $redir_mod 模式\033[0m"
separator_line "="
content_line "\033[36m$SET_REDIR_APPLIED $redir_mod\033[0m"
separator_line "="
sleep 1
} }
# 路由模式设置 # 路由模式设置
@@ -310,16 +266,13 @@ set_redir_mod() {
[ "$firewall_area" = 4 ] && redir_mod="$MENU_PURE_MOD" [ "$firewall_area" = 4 ] && redir_mod="$MENU_PURE_MOD"
[ -z "$redir_mod" ] && redir_mod='Redir' [ -z "$redir_mod" ] && redir_mod='Redir'
firewall_area_dsc=$(echo "$SET_FW_AREA_DESC($bypass_host)" | cut -d'|' -f$firewall_area) firewall_area_dsc=$(echo "$SET_FW_AREA_DESC($bypass_host)" | cut -d'|' -f$firewall_area)
line_break comp_box "\033[33m$SET_REDIR_RESTART_HINT\033[0m" \
separator_line "=" "$SET_REDIR_CURRENT\033[47;30m$redir_mod$MENU_MOD\033[0m $SET_CORE_CURRENT\033[47;30m$crashcore\033[0m"
content_line "\033[33m$SET_REDIR_RESTART_HINT\033[0m"
content_line "$SET_REDIR_CURRENT\033[47;30m$redir_mod$MENU_MOD\033[0m $SET_CORE_CURRENT\033[47;30m$crashcore\033[0m"
separator_line "="
[ "$firewall_area" -le 3 ] && { [ "$firewall_area" -le 3 ] && {
content_line "1) \033[32m$SET_REDIR_REDIR\033[0m\t$SET_REDIR_REDIRDES" content_line "1) 设为\033[32m$SET_REDIR_REDIR\033[0m\t$SET_REDIR_REDIRDES"
content_line "2) \033[36m$SET_REDIR_MIX\033[0m\t$SET_REDIR_MIXDES" content_line "2) 设为\033[36m$SET_REDIR_MIX\033[0m\t$SET_REDIR_MIXDES"
content_line "3) \033[32m$SET_REDIR_TPROXY\033[0m$SET_REDIR_TPROXYDES" content_line "3) 设为\033[32m$SET_REDIR_TPROXY\033[0m\t$SET_REDIR_TPROXYDES"
content_line "4) \033[33m$SET_REDIR_TUN\033[0m\t$SET_REDIR_TUNDES" content_line "4) 设为\033[33m$SET_REDIR_TUN\033[0m\t$SET_REDIR_TUNDES"
content_line "" content_line ""
} }
[ "$firewall_area" = 5 ] && { [ "$firewall_area" = 5 ] && {
@@ -327,14 +280,12 @@ set_redir_mod() {
content_line "6) \033[36mT&U旁路转发\033[0m 转发TCP&UDP流量至旁路由" content_line "6) \033[36mT&U旁路转发\033[0m 转发TCP&UDP流量至旁路由"
content_line "" content_line ""
} }
content_line "7) $SET_FW_AREA\t\033[47;30m$firewall_area_dsc\033[0m" btm_box "7) $SET_FW_AREA\t\033[47;30m$firewall_area_dsc\033[0m" \
content_line "8) $SET_VM_REDIR\t\033[47;30m$vm_redir\033[0m" "8) $SET_VM_REDIR\t\033[47;30m$vm_redir\033[0m" \
content_line "9) $SET_FW_SWITCH\t\033[47;30m$firewall_mod\033[0m" "9) $SET_FW_SWITCH\t\033[47;30m$firewall_mod\033[0m" \
content_line "" "" \
content_line "0 $COMMON_BACK" "0) $COMMON_BACK"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -348,12 +299,8 @@ set_redir_mod() {
redir_mod=Mix redir_mod=Mix
set_redir_config set_redir_config
else else
line_break msg_alert "\033[31m${SET_NO_MOD}TUN\033[0m" \
separator_line "=" "\033[31m$SET_NO_MOD2\033[0m"
content_line "\033[31m${SET_NO_MOD}TUN\033[0m"
content_line "\033[31m$SET_NO_MOD2\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
3) 3)
@@ -369,24 +316,16 @@ set_redir_mod() {
redir_mod=Tproxy redir_mod=Tproxy
set_redir_config set_redir_config
else else
line_break msg_alert "\033[31m${SET_NO_MOD}iptables-mod-tproxy\033[0m" \
separator_line "=" "\033[31m$SET_NO_MOD2\033[0m"
content_line "\033[31m${SET_NO_MOD}iptables-mod-tproxy\033[0m"
content_line "\033[31m$SET_NO_MOD2\033[0m"
separator_line "="
sleep 1
fi fi
elif [ "$firewall_mod" = "nftables" ]; then elif [ "$firewall_mod" = "nftables" ]; then
if modprobe nft_tproxy >/dev/null 2>&1 || lsmod 2>/dev/null | grep -q nft_tproxy; then if modprobe nft_tproxy >/dev/null 2>&1 || lsmod 2>/dev/null | grep -q nft_tproxy; then
redir_mod=Tproxy redir_mod=Tproxy
set_redir_config set_redir_config
else else
line_break msg_alert "\033[31m${SET_NO_MOD}nft_tproxy\033[0m" \
separator_line "=" "\033[31m$SET_NO_MOD2\033[0m"
content_line "\033[31m${SET_NO_MOD}nft_tproxy\033[0m"
content_line "\033[31m$SET_NO_MOD2\033[0m"
separator_line "="
sleep 1
fi fi
fi fi
;; ;;
@@ -395,11 +334,7 @@ set_redir_mod() {
redir_mod=Tun redir_mod=Tun
set_redir_config set_redir_config
else else
line_break msg_alert "\033[31m$SET_NO_TUN\033[0m"
separator_line "="
content_line "\033[31m$SET_NO_TUN\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
5) 5)
@@ -423,10 +358,7 @@ set_redir_mod() {
redir_mod=Redir redir_mod=Redir
setconfig redir_mod $redir_mod setconfig redir_mod $redir_mod
else else
line_break msg_alert "\033[31m$FW_NO_NFTABLES\033[0m"
separator_line "="
content_line "\033[31m$FW_NO_NFTABLES\033[0m"
separator_line "="
fi fi
elif [ "$firewall_mod" = 'nftables' ]; then elif [ "$firewall_mod" = 'nftables' ]; then
if ckcmd iptables; then if ckcmd iptables; then
@@ -434,10 +366,7 @@ set_redir_mod() {
redir_mod=Redir redir_mod=Redir
setconfig redir_mod $redir_mod setconfig redir_mod $redir_mod
else else
line_break msg_alert "\033[31m$FW_NO_IPTABLES\033[0m"
separator_line "="
content_line "\033[31m$FW_NO_IPTABLES\033[0m"
separator_line "="
fi fi
else else
iptables -j REDIRECT -h >/dev/null 2>&1 && firewall_mod=iptables iptables -j REDIRECT -h >/dev/null 2>&1 && firewall_mod=iptables
@@ -447,18 +376,13 @@ set_redir_mod() {
setconfig redir_mod $redir_mod setconfig redir_mod $redir_mod
setconfig firewall_mod "$firewall_mod" setconfig firewall_mod "$firewall_mod"
else else
line_break msg_alert "\033[31m$FW_NO_FIREWALL_BACKEND\033[0m"
separator_line "="
content_line "\033[31m$FW_NO_FIREWALL_BACKEND\033[0m"
separator_line "="
fi fi
fi fi
sleep 1
setconfig firewall_mod "$firewall_mod" setconfig firewall_mod "$firewall_mod"
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -468,18 +392,12 @@ inputport() {
line_break line_break
read -r -p "$INPUT_PORT165535> " portx read -r -p "$INPUT_PORT165535> " portx
. "$CRASHDIR"/menus/check_port.sh # 加载测试函数 . "$CRASHDIR"/menus/check_port.sh # 加载测试函数
line_break
separator_line "="
if check_port "$portx"; then if check_port "$portx"; then
setconfig "$xport" "$portx" setconfig "$xport" "$portx"
content_line "\033[32m$COMMON_SUCCESS\033[0m" msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
separator_line "="
sleep 1
return 0 return 0
else else
content_line "\033[31m$COMMON_FAILED\033[0m" msg_alert "\033[31m$COMMON_FAILED\033[0m"
separator_line "="
sleep 1
return 1 return 1
fi fi
} }
@@ -491,21 +409,17 @@ set_adv_config() {
[ -z "$secret" ] && secret="$COMMON_UNSET" [ -z "$secret" ] && secret="$COMMON_UNSET"
[ -z "$table" ] && table=100 [ -z "$table" ] && table=100
[ -z "$authentication" ] && auth="$COMMON_UNSET" || auth="******" [ -z "$authentication" ] && auth="$COMMON_UNSET" || auth="******"
comp_box "1) $ADV_HTTP_PORT\t\033[36m$mix_port\033[0m" \
line_break "2) $ADV_HTTP_AUTH\t\033[36m$auth\033[0m" \
separator_line "=" "3) $ADV_REDIR_PORT\t\033[36m$redir_port,$((redir_port + 1))\033[0m" \
content_line "1) $ADV_HTTP_PORT\t\033[36m$mix_port\033[0m" "4) $ADV_DNS_PORT\t\t\033[36m$dns_port\033[0m" \
content_line "2) $ADV_HTTP_AUTH\t\033[36m$auth\033[0m" "5) $ADV_PANEL_PORT\t\t\033[36m$db_port\033[0m" \
content_line "3) $ADV_REDIR_PORT\t\033[36m$redir_port,$((redir_port + 1))\033[0m" "6) $ADV_PANEL_PASS\t\t\033[36m$secret\033[0m" \
content_line "4) $ADV_DNS_PORT\t\t\033[36m$dns_port\033[0m" "8) $ADV_HOST\t\033[36m$host\033[0m" \
content_line "5) $ADV_PANEL_PORT\t\t\033[36m$db_port\033[0m" "9) $ADV_TABLE\t\t\033[36m$table,$((table + 1))\033[0m" \
content_line "6) $ADV_PANEL_PASS\t\t\033[36m$secret\033[0m" "" \
content_line "8) $ADV_HOST\t\033[36m$host\033[0m" "0) $COMMON_BACK"
content_line "9) $ADV_TABLE\t\t\033[36m$table,$((table + 1))\033[0m"
content_line "0) $COMMON_BACK"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -520,35 +434,27 @@ set_adv_config() {
fi fi
;; ;;
2) 2)
line_break comp_box "$ADV_AUTH_FORMAT_DESC" \
separator_line "=" "$ADV_AUTH_WARN" \
content_line "$ADV_AUTH_FORMAT_DESC" "$ADV_AUTH_REMOVE_HINT"
content_line "$ADV_AUTH_WARN"
content_line "$ADV_AUTH_REMOVE_HINT"
separator_line "="
read -r -p "$ADV_AUTH_INPUT> " input read -r -p "$ADV_AUTH_INPUT> " input
line_break
separator_line "="
if [ "$input" = "0" ]; then if [ "$input" = "0" ]; then
authentication="" authentication=""
setconfig authentication setconfig authentication
content_line "\033[32m$ADV_AUTH_REMOVED\033[0m" msg_alert "\033[32m$ADV_AUTH_REMOVED\033[0m"
else else
if [ "$local_proxy" = "ON" ] && [ "$local_type" = "$LOCAL_TYPE_ENV" ]; then if [ "$local_proxy" = "ON" ] && [ "$local_type" = "$LOCAL_TYPE_ENV" ]; then
content_line "\033[33m$ADV_AUTH_ENV_CONFLICT\033[0m" msg_alert "\033[33m$ADV_AUTH_ENV_CONFLICT\033[0m"
else else
authentication=$(echo "$input" | grep :) authentication=$(echo "$input" | grep :)
if [ -n "$authentication" ]; then if [ -n "$authentication" ]; then
setconfig authentication "'$authentication'" setconfig authentication "'$authentication'"
content_line "\033[32m$COMMON_SUCCESS\033[0m" msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else else
content_line "\033[31m$ADV_AUTH_INVALID\033[0m" msg_alert "\033[31m$ADV_AUTH_INVALID\033[0m"
fi fi
fi fi
fi fi
separator_line "="
sleep 1
;; ;;
3) 3)
xport=redir_port xport=redir_port
@@ -582,59 +488,48 @@ set_adv_config() {
read -r -p "$ADV_PANEL_PASS_INPUT> " secret read -r -p "$ADV_PANEL_PASS_INPUT> " secret
if [ -n "$secret" ]; then if [ -n "$secret" ]; then
[ "$secret" = "0" ] && secret="" [ "$secret" = "0" ] && secret=""
setconfig secret "$secret" if setconfig secret "$secret"; then
line_break common_success
separator_line "=" else
content_line "\033[32m$COMMON_SUCCESS\033[0m" common_failed
separator_line "=" fi
fi fi
;; ;;
8) 8)
line_break comp_box "\033[33m$ADV_HOST_WARN_LAN\033[0m" \
separator_line "=" "\033[31m$ADV_HOST_WARN_CHANGE\033[0m"
content_line "\033[33m$ADV_HOST_WARN_LAN\033[0m"
content_line "\033[31m$ADV_HOST_WARN_CHANGE\033[0m"
separator_line "="
read -r -p "$ADV_HOST_INPUT> " host read -r -p "$ADV_HOST_INPUT> " host
line_break
separator_line "="
if [ "$host" = "0" ]; then if [ "$host" = "0" ]; then
host="" host=""
setconfig host "$host" setconfig host "$host"
content_line "\033[32m$ADV_HOST_REMOVED\033[0m" msg_alert "\033[32m$ADV_HOST_REMOVED\033[0m"
separator_line "=" line_break
sleep 1
exit 0 exit 0
elif echo "$host" | grep -Eq '\<([1-9]|[1-9][0-9]|1[0-9]{2}|2[01][0-9]|22[0-3])\>(\.\<([0-9]|[0-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\>){2}\.\<([1-9]|[0-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-4])\>'; then elif echo "$host" | grep -Eq '\<([1-9]|[1-9][0-9]|1[0-9]{2}|2[01][0-9]|22[0-3])\>(\.\<([0-9]|[0-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\>){2}\.\<([1-9]|[0-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-4])\>'; then
setconfig host "$host" if setconfig host "$host"; then
content_line "\033[32m$COMMON_SUCCESS\033[0m" common_success
else
common_failed
fi
else else
host="" host=""
content_line "\033[31m$ADV_HOST_INVALID\033[0m" msg_alert "\033[31m$ADV_HOST_INVALID\033[0m"
fi fi
separator_line "="
sleep 1
;; ;;
9) 9)
line_break comp_box "\033[33m$ADV_TABLE_WARN\033[0m"
separator_line "="
content_line "\033[33m$ADV_TABLE_WARN\033[0m"
separator_line "="
read -r -p "$ADV_TABLE_INPUT> " table read -r -p "$ADV_TABLE_INPUT> " table
if [ -n "$table" ]; then if [ -n "$table" ]; then
[ "$table" = "0" ] && table="100" [ "$table" = "0" ] && table="100"
setconfig table "$table" if setconfig table "$table"; then
common_success
line_break else
separator_line "=" common_failed
content_line "\033[32m$COMMON_SUCCESS\033[0m" fi
separator_line "="
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -643,21 +538,17 @@ set_adv_config() {
set_firewall_area() { set_firewall_area() {
while true; do while true; do
[ -z "$vm_redir" ] && vm_redir='OFF' [ -z "$vm_redir" ] && vm_redir='OFF'
line_break comp_box "\033[33m$FW_AREA_NOTE_1\033[0m" \
separator_line "=" "\033[33m$FW_AREA_NOTE_2\033[0m" \
content_line "\033[33m$FW_AREA_NOTE_1\033[0m" "" \
content_line "\033[33m$FW_AREA_NOTE_2\033[0m" "当前路由劫持范围:$firewall_area_dsc"
content_line "" btm_box "1) \033[32m$FW_AREA_LAN\033[0m" \
content_line "当前路由劫持范围:$firewall_area_dsc" "2) \033[36m$FW_AREA_LOCAL\033[0m" \
separator_line "=" "3) \033[32m$FW_AREA_BOTH\033[0m" \
content_line "1) \033[32m$FW_AREA_LAN\033[0m" "4) $FW_AREA_NONE" \
content_line "2) \033[36m$FW_AREA_LOCAL\033[0m" "" \
content_line "3) \033[32m$FW_AREA_BOTH\033[0m" "0) $COMMON_BACK"
content_line "4) $FW_AREA_NONE"
content_line "0) $COMMON_BACK"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -679,23 +570,16 @@ set_firewall_area() {
4) firewall_area_dsc="$FW_AREA_NONE" ;; 4) firewall_area_dsc="$FW_AREA_NONE" ;;
esac esac
line_break common_success
separator_line "="
content_line "\033[32m操作成功\033[0m"
separator_line "="
sleep 1
;; ;;
5) 5)
line_break comp_box "\033[31m注意\033[0m" \
separator_line "=" "此功能存在多种风险如无网络基础请勿尝试!" \
content_line "\033[31m注意\033[0m" "如需代理UDP请确保旁路由运行了支持UDP代理的模式" \
content_line "此功能存在多种风险如无网络基础请勿尝试!" "如使用systemd方式启动内核依然会空载运行建议使用保守模式" \
content_line "如需代理UDP请确保旁路由运行了支持UDP代理的模式" "\033[33m说明\033[0m" \
content_line "如使用systemd方式启动内核依然会空载运行,建议使用保守模式!" "此功能不启动内核仅配置防火墙转发且子设备无需额外设置网关DNS" \
content_line "\033[33m说明\033[0m" "支持防火墙分流及设备过滤支持部分定时任务但不支持ipv6"
content_line "此功能不启动内核仅配置防火墙转发且子设备无需额外设置网关DNS"
content_line "支持防火墙分流及设备过滤支持部分定时任务但不支持ipv6"
separator_line "="
read -r -p "请直接输入旁路由IPV4地址> " bypass_host read -r -p "请直接输入旁路由IPV4地址> " bypass_host
[ -n "$bypass_host" ] && { [ -n "$bypass_host" ] && {
firewall_area=$num firewall_area=$num
@@ -707,7 +591,6 @@ set_firewall_area() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -715,50 +598,35 @@ set_firewall_area() {
set_firewall_vm() { set_firewall_vm() {
[ -z "$vm_ipv4" ] && vm_ipv4=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep 'brd' | grep -E 'docker|podman|virbr|vnet|ovs|vmbr|veth|vmnic|vboxnet|lxcbr|xenbr|vEthernet' | sed 's/.*inet.//g' | sed 's/ br.*$//g' | sed 's/metric.*$//g' | tr '\n' ' ') [ -z "$vm_ipv4" ] && vm_ipv4=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep 'brd' | grep -E 'docker|podman|virbr|vnet|ovs|vmbr|veth|vmnic|vboxnet|lxcbr|xenbr|vEthernet' | sed 's/.*inet.//g' | sed 's/ br.*$//g' | sed 's/metric.*$//g' | tr '\n' ' ')
line_break comp_box "$VM_DETECT_DESC\033[32m$vm_ipv4\033[0m"
separator_line "=" btm_box "1) \033[32m$VM_ENABLE_AUTO\033[0m" \
content_line "$VM_DETECT_DESC\033[32m$vm_ipv4\033[0m" "2) \033[36m$VM_ENABLE_MANUAL\033[0m" \
separator_line "=" "3) \033[31m$VM_DISABLE\033[0m" \
content_line "1) \033[32m$VM_ENABLE_AUTO\033[0m" "" \
content_line "2) \033[36m$VM_ENABLE_MANUAL\033[0m" "0) $COMMON_BACK"
content_line "3) \033[31m$VM_DISABLE\033[0m"
content_line "0) $COMMON_BACK"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
1) 1)
line_break
separator_line "="
if [ -n "$vm_ipv4" ]; then if [ -n "$vm_ipv4" ]; then
vm_redir=ON vm_redir=ON
content_line "\033[32m操作成功\033[0m" common_success
else else
content_line "\033[33m$VM_NO_NET_DETECTED\033[0m" msg_alert "\033[33m$VM_NO_NET_DETECTED\033[0m"
fi fi
separator_line "="
sleep 1
;; ;;
2) 2)
line_break comp_box "$VM_INPUT_DESC_1" \
separator_line "=" "$VM_INPUT_DESC_2 \033[32m10.88.0.0/16 172.17.0.0/16\033[0m" \
content_line "$VM_INPUT_DESC_1" "" \
content_line "$VM_INPUT_DESC_2 \033[32m10.88.0.0/16 172.17.0.0/16\033[0m" "Tips直接回车确认可返回上级菜单"
content_line ""
content_line "Tips直接回车确认可返回上级菜单"
separator_line "="
read -r -p "$VM_INPUT_NET> " text read -r -p "$VM_INPUT_NET> " text
[ -n "$text" ] && vm_ipv4="$text" && vm_redir=ON [ -n "$text" ] && vm_ipv4="$text" && vm_redir=ON
;; ;;
3) 3)
vm_redir=OFF vm_redir=OFF
vm_ipv4='' vm_ipv4=''
common_success
line_break
separator_line "="
content_line "\033[32m操作成功\033[0m"
separator_line "="
sleep 1
;; ;;
*) ;; *) ;;
esac esac
@@ -776,14 +644,11 @@ set_ipv6() {
[ -z "$ipv6_redir" ] && ipv6_redir=OFF [ -z "$ipv6_redir" ] && ipv6_redir=OFF
[ -z "$ipv6_dns" ] && ipv6_dns=ON [ -z "$ipv6_dns" ] && ipv6_dns=ON
line_break top_box "1) $IPV6_REDIR\t\033[36m$ipv6_redir\033[0m"
separator_line "="
content_line "1) $IPV6_REDIR\t\033[36m$ipv6_redir\033[0m"
[ "$disoverride" != "1" ] && content_line "2) $IPV6_DNS\t\033[36m$ipv6_dns\033[0m" [ "$disoverride" != "1" ] && content_line "2) $IPV6_DNS\t\033[36m$ipv6_dns\033[0m"
content_line "0) $COMMON_BACK" btm_box "" \
separator_line "=" "0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -797,26 +662,18 @@ set_ipv6() {
fi fi
setconfig ipv6_redir $ipv6_redir setconfig ipv6_redir $ipv6_redir
setconfig ipv6_support "$ipv6_support" setconfig ipv6_support "$ipv6_support"
common_success
line_break
separator_line "="
content_line "\033[32m操作成功\033[0m"
separator_line "="
sleep 1
;; ;;
2) 2)
[ "$ipv6_dns" = OFF ] && ipv6_dns=ON || ipv6_dns=OFF [ "$ipv6_dns" = OFF ] && ipv6_dns=ON || ipv6_dns=OFF
setconfig ipv6_dns "$ipv6_dns" if setconfig ipv6_dns "$ipv6_dns"; then
common_success
line_break else
separator_line "=" common_failed
content_line "\033[32m操作成功\033[0m" fi
separator_line "="
sleep 1
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done

View File

@@ -37,138 +37,110 @@ setboot() {
check_autostart && auto_set="ON" || auto_set="OFF" check_autostart && auto_set="ON" || auto_set="OFF"
[ "${BINDIR}" = "$CRASHDIR" ] && mini_clash=OFF || mini_clash=ON [ "${BINDIR}" = "$CRASHDIR" ] && mini_clash=OFF || mini_clash=ON
[ -z "$network_check" ] && network_check=ON [ -z "$network_check" ] && network_check=ON
line_break comp_box "\033[30;47m启动设置菜单\033[0m"
separator_line "="
content_line "\033[30;47m启动设置菜单\033[0m"
separator_line "="
content_line "1) 开机自启动: \033[36m$(printf '%-4s' "$auto_set")\033[0m" content_line "1) 开机自启动: \033[36m$(printf '%-4s' "$auto_set")\033[0m"
content_line "2) 使用保守模式: \033[36m$(printf '%-4s' "$start_old")\033[0m ———基于定时任务(每分钟检测)" content_line "2) 使用保守模式: \033[36m$(printf '%-4s' "$start_old")\033[0m ———基于定时任务(每分钟检测)"
content_line "3) 设置自启延时: \033[36m$(printf '%-7s' "$delay")\033[0m ———用于解决自启后服务受限" content_line "3) 设置自启延时: \033[36m$(printf '%-7s' "$delay")\033[0m ———用于解决自启后服务受限"
content_line "4) 启用小闪存模式: \033[36m$(printf '%-4s' "$mini_clash")\033[0m ———用于闪存空间不足的设备" content_line "4) 启用小闪存模式: \033[36m$(printf '%-4s' "$mini_clash")\033[0m ———用于闪存空间不足的设备"
[ "${BINDIR}" != "$CRASHDIR" ] && content_line "5) 设置小闪存目录: \033[36m${BINDIR}\033[0m" [ "${BINDIR}" != "$CRASHDIR" ] && content_line "5) 设置小闪存目录: \033[36m${BINDIR}\033[0m"
content_line "6) 自启网络检查: \033[36m$(printf '%-4s' "$network_check")\033[0m ———禁用则跳过自启时网络检查" btm_box "6) 自启网络检查: \033[36m$(printf '%-4s' "$network_check")\033[0m ———禁用则跳过自启时网络检查" \
content_line "0) 返回上级菜单" "7) 查看启动日志" \
separator_line "=" "" \
"0) 返回上级菜单"
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
1) 1)
line_break
separator_line "="
if check_autostart; then if check_autostart; then
# 禁止自启动:删除各系统的启动项 # 禁止自启动:删除各系统的启动项
disable_autostart disable_autostart
content_line "\033[33m已禁止ShellCrash开机自启动\033[0m" msg_alert "\033[33m已禁止ShellCrash开机自启动\033[0m"
else else
# 允许自启动:配置各系统的启动项 # 允许自启动:配置各系统的启动项
allow_autostart allow_autostart
content_line "\033[32m已设置ShellCrash开机自启动\033[0m" msg_alert "\033[32m已设置ShellCrash开机自启动\033[0m"
fi fi
separator_line "="
;; ;;
2) 2)
line_break
separator_line "="
if [ "$start_old" = "OFF" ] >/dev/null 2>&1; then if [ "$start_old" = "OFF" ] >/dev/null 2>&1; then
disable_autostart disable_autostart
start_old=ON start_old=ON
setconfig start_old "$start_old" setconfig start_old "$start_old"
"$CRASHDIR"/start.sh stop "$CRASHDIR"/start.sh stop
content_line "\033[33m改为使用保守模式启动服务\033[0m" msg_alert "\033[33m改为使用保守模式启动服务\033[0m"
else else
if grep -qE 'procd|systemd|s6' /proc/1/comm || rc-status -r >/dev/null 2>&1; then if grep -qE 'procd|systemd|s6' /proc/1/comm || rc-status -r >/dev/null 2>&1; then
"$CRASHDIR"/start.sh cronset "ShellCrash初始化" "$CRASHDIR"/start.sh cronset "ShellCrash初始化"
start_old=OFF start_old=OFF
setconfig start_old "$start_old" setconfig start_old "$start_old"
"$CRASHDIR"/start.sh stop "$CRASHDIR"/start.sh stop
content_line "\033[32m改为使用系统守护进程启动服务\033[0m" msg_alert "\033[32m改为使用系统守护进程启动服务\033[0m"
else else
content_line "\033[31m当前设备不支持以其他模式启动\033[0m" msg_alert "\033[31m当前设备不支持以其他模式启动\033[0m"
fi fi
fi fi
separator_line "="
sleep 1
;; ;;
3) 3)
line_break comp_box "\033[33m如果你的设备启动后可以正常使用则无需设置\033[0m" \
separator_line "=" "\033[36m推荐设置为30120秒之间请根据设备问题自行试验\033[0m"
content_line "\033[33m如果你的设备启动后可以正常使用则无需设置\033[0m"
content_line "\033[36m推荐设置为30120秒之间请根据设备问题自行试验\033[0m"
separator_line "="
read -r -p "请输入启动延迟时间0300秒> " sec read -r -p "请输入启动延迟时间0300秒> " sec
line_break
separator_line "="
case "$sec" in case "$sec" in
[0-9] | [0-9][0-9] | [0-2][0-9][0-9] | 300) [0-9] | [0-9][0-9] | [0-2][0-9][0-9] | 300)
start_delay=$sec start_delay=$sec
setconfig start_delay "$sec" setconfig start_delay "$sec"
content_line "\033[32m设置成功\033[0m" msg_alert "\033[32m设置成功\033[0m"
;; ;;
*) *)
content_line "\033[31m输入有误或超过300秒请重新输入\033[0m" msg_alert "\033[31m输入有误或超过300秒请重新输入\033[0m"
;; ;;
esac esac
separator_line "="
sleep 1
;; ;;
4) 4)
dir_size=$(df "$CRASHDIR" | awk '{ for(i=1;i<=NF;i++){ if(NR==1){ arr[i]=$i; }else{ arr[i]=arr[i]" "$i; } } } END{ for(i=1;i<=NF;i++){ print arr[i]; } }' | grep Ava | awk '{print $2}') dir_size=$(df "$CRASHDIR" | awk '{ for(i=1;i<=NF;i++){ if(NR==1){ arr[i]=$i; }else{ arr[i]=arr[i]" "$i; } } } END{ for(i=1;i<=NF;i++){ print arr[i]; } }' | grep Ava | awk '{print $2}')
line_break
separator_line "="
if [ "$mini_clash" = "OFF" ]; then if [ "$mini_clash" = "OFF" ]; then
if [ "$dir_size" -gt 20480 ]; then if [ "$dir_size" -gt 20480 ]; then
content_line "\033[33m您的设备空间充足>20M无需开启\033[0m" msg_alert "\033[33m您的设备空间充足>20M无需开启\033[0m"
elif [ "$start_old" != 'ON' ] && [ "$(cat /proc/1/comm)" = "systemd" ]; then elif [ "$start_old" != 'ON' ] && [ "$(cat /proc/1/comm)" = "systemd" ]; then
content_line "\033[33m不支持systemd启动模式请先启用保守模式\033[0m" msg_alert "\033[33m不支持systemd启动模式请先启用保守模式\033[0m"
else else
[ "$BINDIR" = "$CRASHDIR" ] && BINDIR="$TMPDIR" [ "$BINDIR" = "$CRASHDIR" ] && BINDIR="$TMPDIR"
content_line "\033[32m已经启用小闪存功能\033[0m" msg_alert "\033[32m已经启用小闪存功能\033[0m" \
content_line "如需更换目录,请使用【设置小闪存目录】功能\033[0m" "如需更换目录,请使用【设置小闪存目录】功能\033[0m"
fi fi
separator_line "="
else else
if [ "$dir_size" -lt 8192 ]; then if [ "$dir_size" -lt 8192 ]; then
content_line "\033[31m您的设备剩余空间不足8M停用后可能无法正常运行\033[0m" comp_box "\033[31m您的设备剩余空间不足8M停用后可能无法正常运行\033[0m" \
content_line "是否确认停用此功能" "是否确认停用此功能"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
BINDIR="$CRASHDIR" BINDIR="$CRASHDIR"
line_break msg_alert "\033[33m已经停用小闪存功能\033[0m"
separator_line "="
content_line "\033[33m已经停用小闪存功能\033[0m"
separator_line "="
else else
continue continue
fi fi
else else
rm -rf /tmp/ShellCrash rm -rf /tmp/ShellCrash
BINDIR="$CRASHDIR" BINDIR="$CRASHDIR"
content_line "\033[33m已经停用小闪存功能\033[0m" msg_alert "\033[33m已经停用小闪存功能\033[0m"
separator_line "="
fi fi
fi fi
setconfig BINDIR "$BINDIR" "$CRASHDIR"/configs/command.env sed -i "s#BINDIR=.*#BINDIR=$BINDIR#" "$CRASHDIR"/configs/command.env
sleep 1 sleep 1
;; ;;
5) 5)
while true; do while true; do
line_break comp_box "\033[33m如设置到内存则每次开机后都自动重新下载相关文件\033[0m" \
separator_line "=" "\033[33m请确保安装源可用裸连否则会导致启动失败\033[0m"
content_line "\033[33m如设置到内存则每次开机后都自动重新下载相关文件\033[0m" btm_box "1) 使用内存(/tmp" \
content_line "\033[33m请确保安装源可用裸连否则会导致启动失败\033[0m" "2) 选择U盘目录" \
separator_line "=" "3) 自定义目录" \
content_line "1) 使用内存(/tmp" "" \
content_line "2) 选择U盘目录" "0) 返回上级菜单"
content_line "3) 自定义目录"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -180,16 +152,13 @@ setboot() {
2) 2)
set_usb_dir() { set_usb_dir() {
while true; do while true; do
line_break comp_box "请选择安装目录:"
separator_line "="
content_line "请选择安装目录:"
separator_line "="
du -hL /mnt | du -hL /mnt |
awk '{print NR") "$2" (已占用的储存空间:"$1""}' | awk '{print NR") "$2" (已占用的储存空间:"$1""}' |
while IFS= read -r line; do while IFS= read -r line; do
content_line "$line" content_line "$line"
done done
content_line ""
content_line "0) 返回上级菜单" content_line "0) 返回上级菜单"
separator_line "=" separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
@@ -197,10 +166,7 @@ setboot() {
if [ "$num" = 0 ]; then if [ "$num" = 0 ]; then
return 1 return 1
elif [ -z "$BINDIR" ]; then elif [ -z "$BINDIR" ]; then
line_break msg_alert "\033[31m输入错误请重新设置\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新设置\033[0m"
separator_line "="
else else
return 0 return 0
fi fi
@@ -214,20 +180,13 @@ setboot() {
3) 3)
input_dir() { input_dir() {
while true; do while true; do
line_break comp_box "\033[36m请直接输入命令语句\033[0m" \
separator_line "=" "或输入 0 返回上级菜单"
content_line "请直接输入命令语句"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " BINDIR read -r -p "请输入> " BINDIR
if [ "$BINDIR" = 0 ]; then if [ "$BINDIR" = 0 ]; then
return 1 return 1
elif [ ! -d "$BINDIR" ]; then elif [ ! -d "$BINDIR" ]; then
line_break msg_alert "\033[31m输入错误请重新设置\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新设置\033[0m"
separator_line "="
continue
fi fi
return 0 return 0
done done
@@ -239,32 +198,26 @@ setboot() {
;; ;;
*) *)
errornum errornum
sleep 1
continue continue
;; ;;
esac esac
setconfig BINDIR "$BINDIR" "$CRASHDIR"/configs/command.env sed -i "s#BINDIR=.*#BINDIR=$BINDIR#" "$CRASHDIR"/configs/command.env
break break
done done
;; ;;
6) 6)
line_break comp_box "\033[33m如果你的设备启动后可以正常使用则无需变更设置\033[0m" \
separator_line "=" "\033[36m禁用时如果使用了小闪存模式或者rule-set等在线规则则可能会因无法联网而导致启动失败\033[0m" \
content_line "\033[33m如果你的设备启动后可以正常使用则无需变更设置\033[0m" "\033[32m启用时会导致部分性能较差或者拨号较慢的设备可能会因查询超时导致启动失败\033[0m"
content_line "\033[36m禁用时如果使用了小闪存模式或者rule-set等在线规则则可能会因无法联网而导致启动失败\033[0m"
content_line "\033[32m启用时会导致部分性能较差或者拨号较慢的设备可能会因查询超时导致启动失败\033[0m"
separator_line "="
if [ "$network_check" = "OFF" ]; then if [ "$network_check" = "OFF" ]; then
content_line "当前\033[33m已禁用\033[0m自启网络检查是否确认启用" content_line "当前\033[33m已禁用\033[0m自启网络检查是否确认启用"
else else
content_line "当前\033[33m已启用\033[0m自启网络检查是否确认禁用" content_line "当前\033[33m已启用\033[0m自启网络检查是否确认禁用"
fi fi
separator_line "-" separator_line "-"
content_line "1) 是" btm_box "1) 是" \
content_line "0) 否,返回上级菜单" "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = '1' ]; then if [ "$res" = '1' ]; then
if [ "$network_check" = "OFF" ]; then if [ "$network_check" = "OFF" ]; then
@@ -272,18 +225,27 @@ setboot() {
else else
network_check=OFF network_check=OFF
fi fi
setconfig network_check "$network_check" if setconfig network_check "$network_check"; then
common_success
else
common_failed
fi
fi
;;
7)
if [ -s "$TMPDIR"/ShellCrash.log ]; then
line_break line_break
separator_line "=" echo "==========================================================="
content_line "\033[32m操作成功\033[0m" grep -v '任务' "$TMPDIR"/ShellCrash.log
separator_line "=" echo "==========================================================="
sleep 1 line_break
exit
else
msg_alert "\033[31m未找到相关日志\033[0m"
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done

View File

@@ -8,29 +8,23 @@ __IS_MODULE_5_TASK_LOADED=1
. "$CRASHDIR"/libs/set_config.sh . "$CRASHDIR"/libs/set_config.sh
. "$CRASHDIR"/libs/set_cron.sh . "$CRASHDIR"/libs/set_cron.sh
load_lang 5_task
# 任务工具 # 任务工具
set_cron() { set_cron() {
[ -z "$week" ] && week=* [ -z "$week" ] && week=*
[ -z "$hour" ] && hour=* [ -z "$hour" ] && hour=*
[ -z "$min" ] && min=0 [ -z "$min" ] && min=0
line_break comp_box "\033[33m$cron_time\033[0m执行任务\033[36m$task_name\033[0m" \
separator_line "=" "" \
content_line "\033[33m$cron_time\033[0m执行任务\033[36m$task_name\033[0m" "是否确认添加定时任务?"
content_line "" btm_box "1) 是" \
content_line "是否确认添加定时任务:" "0) 否"
separator_line "="
content_line "1) 是"
content_line "0) 否"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = '1' ]; then if [ "$res" = '1' ]; then
task_txt="$min $hour * * $week $CRASHDIR/task/task.sh $task_id $cron_time$task_name" task_txt="$min $hour * * $week $CRASHDIR/task/task.sh $task_id $cron_time$task_name"
cronset "$cron_time$task_name" "$task_txt" cronset "$cron_time$task_name" "$task_txt"
msg_alert -t 0 "任务【$cron_time$task_name】\033[32m已添加\033[0m"
line_break
separator_line "="
content_line "任务【$cron_time$task_name】\033[32m已添加\033[0m"
separator_line "="
fi fi
unset week hour min unset week hour min
sleep 1 sleep 1
@@ -48,7 +42,7 @@ set_service() {
else else
echo "$CRASHDIR/task/task.sh $2 $3" >>"$task_file" echo "$CRASHDIR/task/task.sh $2 $3" >>"$task_file"
fi fi
content_line "任务$3】\033[32m添加成功!\033[0m" content_line "$3】\033[32m$COMMON_SUCCESS\033[0m"
sleep 1 sleep 1
} }
@@ -57,24 +51,17 @@ set_service() {
# 自定义命令添加 # 自定义命令添加
task_user_add() { task_user_add() {
while true; do while true; do
line_break comp_box "\033[33m命令可包含空格请确保命令可执行\033[0m" \
separator_line "=" "\033[36m请勿附带执行条件执行条件请在命令添加完成后再返回设置\033[0m" \
content_line "\033[33m命令可包含空格请确保命令可执行\033[0m" "亦可手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m以添加命令"
content_line "\033[36m请勿附带执行条件执行条件请在命令添加完成后再返回设置\033[0m" btm_box "\033[36m请直接输入命令语句\033[0m" \
content_line "亦可手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m以添加命令" "或输入 0 返回上级菜单"
separator_line "-"
content_line "请直接输入命令语句"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " script read -r -p "请输入> " script
if [ "$script" = 0 ]; then if [ "$script" = 0 ]; then
break break
elif [ -n "$script" ]; then elif [ -n "$script" ]; then
task_command=$script task_command=$script
line_break comp_box "请检查输入:\033[32m$task_command\033[0m"
separator_line "="
content_line "请检查输入:\033[32m$task_command\033[0m"
separator_line "="
# 获取本任务ID # 获取本任务ID
task_max_id=$(awk -F '#' '{print $1}' "$CRASHDIR"/task/task.user 2>/dev/null | sort -n | tail -n 1) task_max_id=$(awk -F '#' '{print $1}' "$CRASHDIR"/task/task.user 2>/dev/null | sort -n | tail -n 1)
[ -z "$task_max_id" ] && task_max_id=200 [ -z "$task_max_id" ] && task_max_id=200
@@ -82,19 +69,10 @@ task_user_add() {
read -r -p "请输入任务备注> " txt read -r -p "请输入任务备注> " txt
[ -n "$txt" ] && task_name=$txt || task_name=自定义任务$task_id [ -n "$txt" ] && task_name=$txt || task_name=自定义任务$task_id
echo "$task_id#$task_command#$task_name" >>"$CRASHDIR"/task/task.user echo "$task_id#$task_command#$task_name" >>"$CRASHDIR"/task/task.user
msg_alert "\033[32m自定义任务已添加\033[0m"
line_break
separator_line "="
content_line "\033[32m自定义任务已添加\033[0m"
separator_line "="
sleep 1
break break
else else
line_break msg_alert "\033[31m输入错误请重新输入\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新输入\033[0m"
separator_line "="
sleep 1
fi fi
done done
} }
@@ -102,44 +80,27 @@ task_user_add() {
# 自定义命令删除 # 自定义命令删除
task_user_del() { task_user_del() {
while true; do while true; do
line_break
separator_line "="
if grep -Evq '^#' "$CRASHDIR/task/task.user" 2>/dev/null; then if grep -Evq '^#' "$CRASHDIR/task/task.user" 2>/dev/null; then
content_line "请输入对应ID移除对应自定义任务不会影响内置任务" comp_box "请输入对应ID移除对应自定义任务不会影响内置任务" \
content_line "也可以手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m" "也可以手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m"
separator_line "="
grep -Ev '^#' "$CRASHDIR/task/task.user" 2>/dev/null | grep -Ev '^#' "$CRASHDIR/task/task.user" 2>/dev/null |
awk -F '#' '{print $1") "$3}' | awk -F '#' '{print $1") "$3}' |
while IFS= read -r line; do while IFS= read -r line; do
content_line "$line" content_line "$line"
done done
btm_box "" \
content_line "" "0) 返回上级菜单"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
if [ "$num" = 0 ]; then if [ "$num" = 0 ]; then
break break
elif [ -n "$num" ]; then elif [ -n "$num" ]; then
sed -i "/^$num#/d" "$CRASHDIR"/task/task.user 2>/dev/null sed -i "/^$num#/d" "$CRASHDIR"/task/task.user 2>/dev/null
common_success
line_break
separator_line "="
content_line "\033[32m操作成功\033[0m"
separator_line "="
sleep 1
else else
line_break msg_alert "\033[31m输入错误请重新输入\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新输入\033[0m"
separator_line "="
sleep 1
fi fi
else else
content_line "\033[33m你暂未添加任何自定义任务\033[0m" msg_alert "\033[33m你暂未添加任何自定义任务\033[0m"
separator_line "="
sleep 1
break break
fi fi
done done
@@ -148,39 +109,29 @@ task_user_del() {
# 任务添加 # 任务添加
task_add() { task_add() {
while true; do while true; do
line_break comp_box "\033[36m请选择需要添加的任务\033[0m"
separator_line "="
content_line "\033[36m请选择需要添加的任务\033[0m"
separator_line "="
# 输出任务列表 # 输出任务列表
# cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | awk -F '#' '{print NR") "$3}' list=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | awk -F '#' '{print $3}')
grep -Ev '^(#|$)' "$CRASHDIR/task/task.list" "$CRASHDIR/task/task.user" 2>/dev/null | list_box "$list"
awk -F '#' '{print NR") "$3}' | btm_box "" \
while IFS= read -r line; do "0) 返回上级菜单"
content_line "$line"
done
content_line ""
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
0) 0)
break break
;; ;;
[1-9] | [1-9][0-9]) [1-9] | [1-9][0-9])
if [ "$num" -le "$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | wc -l)" ]; then if [ "$num" -le "$(echo "$list" | wc -l)" ]; then
task_id=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $1}') task_id=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $1}')
task_name=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $3}') task_name=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep -Ev '^(#|$)' | sed -n "$num p" | awk -F '#' '{print $3}')
task_type task_type
break break
else else
errornum errornum
sleep 1
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -189,9 +140,7 @@ task_add() {
# 任务删除 # 任务删除
task_del() { task_del() {
# 删除定时任务 # 删除定时任务
croncmd -l >"$TMPDIR"/cron cronset "$1"
sed -i "/$1/d" "$TMPDIR"/cron && croncmd "$TMPDIR"/cron
rm -f "$TMPDIR"/cron
# 删除条件任务 # 删除条件任务
sed -i "/$1/d" "$CRASHDIR"/task/cron 2>/dev/null sed -i "/$1/d" "$CRASHDIR"/task/cron 2>/dev/null
sed -i "/$1/d" "$CRASHDIR"/task/bfstart 2>/dev/null sed -i "/$1/d" "$CRASHDIR"/task/bfstart 2>/dev/null
@@ -202,36 +151,30 @@ task_del() {
# 任务条件选择菜单 # 任务条件选择菜单
task_type() { task_type() {
line_break comp_box "请选择任务\033[36m【$task_name】\033[0m执行条件"
separator_line "=" btm_box "1) 定时任务\033[32m每周执行\033[0m" \
content_line "请选择任务\033[36m【$task_name】\033[0m执行条件" "2) 定时任务\033[32m每日执行\033[0m" \
separator_line "=" "3) 定时任务\033[32m每小时执行\033[0m" \
content_line "1) 定时任务\033[32m每执行\033[0m" "4) 定时任务\033[32m每分钟执行\033[0m" \
content_line "2) 定时任务\033[32m每日执行\033[0m" " - - - - - - - - -\033[31m注意\033[0m- - - - - - - - -" \
content_line "3) 定时任务\033[32m每小时执行\033[0m" " 逻辑水平不及格的请勿使用下方触发条件!" \
content_line "4) 定时任务\033[32m每分钟执行\033[0m" " - - - - - - - - - - - - - - - - - - - -" \
content_line " - - - - - - - - -\033[31m注意\033[0m- - - - - - - - -" "5) 服务\033[33m启动前执行\033[0m" \
content_line " 逻辑水平不及格的请勿使用下方触发条件!" "6) 服务\033[33m启动后执行\033[0m" \
content_line " - - - - - - - - - - - - - - - - - - - -" "7) 服务\033[33m运行时每分钟执行\033[0m" \
content_line "5) 服务\033[33m启动前执行\033[0m" "8) 防火墙服务\033[33m重启后执行\033[0m" \
content_line "6) 服务\033[33m启动后执行\033[0m" "" \
content_line "7) 服务\033[33m运行时每分钟执行\033[0m" "0) 返回上级菜单"
content_line "8) 防火墙服务\033[33m重启后执行\033[0m"
content_line ""
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
0) 0)
return 1 return 1
;; ;;
1) 1)
line_break
separator_line "=" comp_box "输入 17 对应\033[33m每周的指定某天\033[0m运行7=周日)" \
content_line "输入 17 对应\033[33m每周的指定某天\033[0m运行7=周日)" "输入 140 代表\033[36m每周一、周四、周日\033[0m运行" \
content_line "输入 140 代表\033[36m周一、周四、周日\033[0m运行" "输入 15 代表\033[36m周一至周五\033[0m运行"
content_line "输入 15 代表\033[36m周一至周五\033[0m运行"
separator_line "="
read -r -p "在每周哪天执行?> " week read -r -p "在每周哪天执行?> " week
# week=`echo ${week/7/0}` # 把7换成0 # week=`echo ${week/7/0}` # 把7换成0
read -r -p "想在该日的具体哪个小时执行023> " hour read -r -p "想在该日的具体哪个小时执行023> " hour
@@ -240,13 +183,9 @@ task_type() {
[ -n "$week" ] && [ -n "$hour" ] && set_cron [ -n "$week" ] && [ -n "$hour" ] && set_cron
;; ;;
2) 2)
line_break comp_box "输入 1715 代表\033[36m每到1715点\033[0m运行" \
separator_line "=" "输入 618 代表\033[36m早6点至晚18点间每小时\033[0m运行"
content_line "输入 1715 代表\033[36m每到1715点\033[0m运行"
content_line "输入 618 代表\033[36m早6点至晚18点间每小时\033[0m运行"
separator_line "="
read -r -p "想在每日的具体哪个小时执行0~23> " hour read -r -p "想在每日的具体哪个小时执行0~23> " hour
read -r -p "想在具体哪分钟执行059的整数> " min read -r -p "想在具体哪分钟执行059的整数> " min
cron_time="在每日的$hour点$min分" cron_time="在每日的$hour点$min分"
[ -n "$min" ] && [ -n "$hour" ] && set_cron [ -n "$min" ] && [ -n "$hour" ] && set_cron
@@ -272,11 +211,8 @@ task_type() {
set_service afstart "$task_id" "服务启动后$task_name" set_service afstart "$task_id" "服务启动后$task_name"
;; ;;
7) 7)
line_break comp_box "输入10即每隔10分钟运行一次1440即每隔24小时运行一次" \
separator_line "=" "大于60分钟的数值将按小时取整且按当前时区记时"
content_line "输入10即每隔10分钟运行一次1440即每隔24小时运行一次"
content_line "大于60分钟的数值将按小时取整且按当前时区记时"
separator_line "="
read -r -p "想每隔多少分钟执行一次11440的整数> " num read -r -p "想每隔多少分钟执行一次11440的整数> " num
if [ "$num" -lt 60 ]; then if [ "$num" -lt 60 ]; then
min="$num" min="$num"
@@ -290,20 +226,15 @@ task_type() {
[ -n "$cron_time" ] && set_service running "$task_id" "运行时每$time_des$task_name" "$cron_time" [ -n "$cron_time" ] && set_service running "$task_id" "运行时每$time_des$task_name" "$cron_time"
;; ;;
8) 8)
line_break comp_box "该功能会将相关启动代码注入到/etc/init.d/firewall中"
separator_line "=" "是否确认继续?"
content_line "该功能会将相关启动代码注入到/etc/init.d/firewall中" btm_box "1) 是" \
content_line "是否确认继续:" "0) 否"
separator_line "="
content_line "1) 是"
content_line "0) 否"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
[ "$res" = 1 ] && set_service affirewall "$task_id" "防火墙重启后$task_name" [ "$res" = 1 ] && set_service affirewall "$task_id" "防火墙重启后$task_name"
;; ;;
*) *)
errornum errornum
return 1
;; ;;
esac esac
} }
@@ -311,35 +242,25 @@ task_type() {
# 任务管理列表 # 任务管理列表
task_manager() { task_manager() {
while true; do while true; do
line_break
separator_line "="
# 抽取并生成临时列表 # 抽取并生成临时列表
croncmd -l >"$TMPDIR"/task_cronlist cronload >"$TMPDIR"/task_cronlist
cat "$TMPDIR"/task_cronlist "$CRASHDIR"/task/running 2>/dev/null | sort -u | grep -oE "task/task.sh .*" | awk -F ' ' '{print $2" "$3}' >"$TMPDIR"/task_list cat "$TMPDIR"/task_cronlist "$CRASHDIR"/task/running 2>/dev/null | sort -u | grep -oE "task/task.sh .*" | cut -d ' ' -f 2- >"$TMPDIR"/task_list
cat "$CRASHDIR"/task/bfstart "$CRASHDIR"/task/afstart "$CRASHDIR"/task/affirewall 2>/dev/null | awk -F ' ' '{print $2" "$3}' >>"$TMPDIR"/task_list cat "$CRASHDIR"/task/bfstart "$CRASHDIR"/task/afstart "$CRASHDIR"/task/affirewall 2>/dev/null | cut -d ' ' -f 2- >>"$TMPDIR"/task_list
cat "$TMPDIR"/task_cronlist 2>/dev/null | sort -u | grep -oE " #.*" | grep -v "守护" | awk -F '#' '{print "0 旧版任务-"$2}' >>"$TMPDIR"/task_list cat "$TMPDIR"/task_cronlist 2>/dev/null | sort -u | grep -oE " #.*" | grep -v "守护" | awk -F '#' '{print "0 旧版任务-"$2}' >>"$TMPDIR"/task_list
sed -i '/^ *$/d' "$TMPDIR"/task_list sed -i '/^ *$/d' "$TMPDIR"/task_list
rm -rf "$TMPDIR"/task_cronlist rm -rf "$TMPDIR"/task_cronlist
# 判断为空则返回 # 判断为空则返回
if [ ! -s "$TMPDIR"/task_list ]; then if [ ! -s "$TMPDIR"/task_list ]; then
content_line "\033[31m当前没有可供管理的任务\033[36m" msg_alert "\033[31m当前没有可供管理的任务\033[36m"
separator_line "="
sleep 1
break break
else else
content_line "\033[33m已添加的任务\033[0m" comp_box "\033[33m已添加的任务\033[0m"
separator_line "=" list_box "$(cat "$TMPDIR"/task_list)"
# cat "$TMPDIR"/task_list | awk '{print NR ") " $2}'
awk '{print NR ") " $2}' "$TMPDIR/task_list" |
while IFS= read -r line; do
content_line "$line"
done
separator_line "-" separator_line "-"
content_line "a) 清空旧版任务" btm_box "a) 清空旧版任务" \
content_line "d) 清空任务列表" "d) 清空任务列表" \
content_line "0) 返回上级菜单" "" \
separator_line "=" "0) 返回上级菜单"
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -347,52 +268,38 @@ task_manager() {
;; ;;
a) a)
task_del "#" task_del "#"
line_break msg_alert "\033[31m旧版任务已清空\033[36m"
separator_line "="
content_line "\033[31m旧版任务已清空\033[36m"
separator_line "="
sleep 1
;; ;;
d) d)
task_del "task.sh" task_del "task.sh"
line_break msg_alert "\033[31m全部任务已清空\033[36m"
separator_line "="
content_line "\033[31m全部任务已清空\033[36m"
separator_line "="
sleep 1
;; ;;
[1-9] | [1-9][0-9]) [1-9] | [1-9][0-9])
task_txt=$(sed -n "$num p" "$TMPDIR"/task_list) task_txt=$(sed -n "$num p" "$TMPDIR"/task_list)
task_id=$(echo "$task_txt" | awk '{print $1}') task_id=$(echo "$task_txt" | awk '{print $1}')
line_break
separator_line "="
if [ "$task_id" = 0 ]; then if [ "$task_id" = 0 ]; then
content_line "旧版任务不支持管理,是否移除" comp_box "旧版任务不支持管理,是否移除"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
cronname=$(echo "$task_txt" | awk -F '-' '{print $2}') cronname=$(echo "$task_txt" | awk -F '-' '{print $2}')
croncmd -l >"$TMPDIR"/conf && sed -i "/$cronname/d" "$TMPDIR"/conf && croncmd "$TMPDIR"/conf cronset "$cronname"
sed -i "/$cronname/d" $clashdir/tools/cron 2>/dev/null sed -i "/$cronname/d" "$CRASHDIR"/task/cron 2>/dev/null
rm -f "$TMPDIR"/conf
break break
fi fi
else else
task_des=$(echo "$task_txt" | awk '{print $2}') task_des=$(echo "$task_txt" | awk '{print $2}')
task_name=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $3}') task_name=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $3}')
comp_box "当前任务为:\033[36m$task_des\033[0m"
content_line "当前任务为:\033[36m$task_des\033[0m" btm_box "1) \033[33m修改\033[0m当前任务" \
separator_line "=" "2) \033[31m删除\033[0m当前任务" \
content_line "1) \033[33m修改\033[0m当前任务" "3) \033[32m立即执行\033[0m一次" \
content_line "2) \033[31m删除\033[0m当前任务" "4) 查看\033[33m执行记录\033[0m" \
content_line "3) \033[32m立即执行\033[0m一次" "" \
content_line "4) 查看\033[33m执行记录\033[0m" "0) 返回上级菜单"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -403,41 +310,31 @@ task_manager() {
;; ;;
2) 2)
task_del "$task_des" task_del "$task_des"
line_break common_success
separator_line "="
content_line "\033[32m操作成功\033[0m"
separator_line "="
;; ;;
3) 3)
task_command=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $2}') task_command=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$task_id" | awk -F '#' '{print $2}')
eval "$task_command" && task_res='执行成功!' || task_res='执行失败!' eval "$task_command" && task_res='执行成功!' || task_res='执行失败!'
line_break msg_alert "\033[33m任务【$task_des$task_res\033[0m"
separator_line "="
content_line "\033[33m任务【$task_des$task_res\033[0m"
separator_line "="
sleep 1
;; ;;
4) 4)
line_break
if cat "$TMPDIR"/ShellCrash.log | grep -q "$task_name"; then if cat "$TMPDIR"/ShellCrash.log | grep -q "$task_name"; then
line_break
echo "==========================================================="
cat "$TMPDIR"/ShellCrash.log | grep "$task_name" cat "$TMPDIR"/ShellCrash.log | grep "$task_name"
echo "==========================================================="
else else
separator_line "=" msg_alert "\033[31m未找到相关执行记录\033[0m"
content_line "\033[31m未找到相关执行记录\033[0m"
separator_line "="
fi fi
sleep 1
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
fi fi
@@ -446,24 +343,22 @@ task_manager() {
# 任务推荐 # 任务推荐
task_recom() { task_recom() {
line_break comp_box "\033[36m$TASK_RECOM_TITLE\033[0m" \
separator_line "=" "" \
content_line "\033[36m是否启用以下推荐的自动任务配置\033[0m" "$TASK_RECOM_ITEM_1" \
content_line "每隔10分钟自动保存面板配置" "$TASK_RECOM_ITEM_2" \
content_line "服务启动后自动同步ntp时间" "$TASK_RECOM_ITEM_3"
content_line "在每日的3点0分重启服务" btm_box "1) 是" \
separator_line "=" "0) 否"
content_line "1) 是" read -r -p "$COMMON_INPUT>" res
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
line_break line_break
separator_line "=" separator_line "="
set_service running "106" "运行时每10分钟自动保存面板配置" "*/10 * * * *" set_service running "106" "$TASK_RECOM_ITEM_1" "*/10 * * * *"
set_service afstart "107" "服务启动后自动同步ntp时间" set_service afstart "107" "$TASK_RECOM_ITEM_2"
cronset "在每日的3点0分重启服务" "0 3 * * * ${CRASHDIR}/task/task.sh 103 在每日的3点0分重启服务" && cronset "$TASK_RECOM_ITEM_3" "0 3 * * * ${CRASHDIR}/task/task.sh 103 $TASK_RECOM_ITEM_3" &&
content_line "任务【在每日的3点0分重启服务】\033[32m添加成功\033[0m" content_line "$TASK_RECOM_ITEM_3】\033[32m$COMMON_SUCCESS\033[0m"
separator_line "=" separator_line "="
} }
} }
@@ -473,19 +368,16 @@ task_menu() {
while true; do while true; do
# 检测并创建自定义任务文件 # 检测并创建自定义任务文件
[ -f "$CRASHDIR"/task/task.user ] || echo '#任务ID(必须>200并顺序排列)#任务命令#任务说明(#号隔开,任务命令和说明中都不允许包含#号)' >"$CRASHDIR"/task/task.user [ -f "$CRASHDIR"/task/task.user ] || echo '#任务ID(必须>200并顺序排列)#任务命令#任务说明(#号隔开,任务命令和说明中都不允许包含#号)' >"$CRASHDIR"/task/task.user
line_break comp_box "\033[30;47m自动任务菜单\033[0m"
separator_line "=" btm_box "1) 添加\033[32m自动任务\033[0m" \
content_line "\033[30;47m自动任务菜单\033[0m" "2) 管理\033[33m任务列表\033[0m" \
separator_line "=" "3) 查看\033[36m任务日志\033[0m" \
content_line "1) 添加\033[32m自动任务\033[0m" "4) 配置\033[36m日志推送\033[0m" \
content_line "2) 管理\033[33m任务列表\033[0m" "5) 添加\033[33m自定义任务\033[0m" \
content_line "3) 查看\033[36m任务日志\033[0m" "6) 删除\033[33m自定义任务\033[0m" \
content_line "4) 配置\033[36m日志推送\033[0m" "7) 使用\033[32m推荐设置\033[0m" \
content_line "5) 添加\033[33m自定义任务\033[0m" "" \
content_line "6) 删除\033[33m自定义任务\033[0m" "0) 返回上级菜单"
content_line "7) 使用\033[32m推荐设置\033[0m"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -499,21 +391,17 @@ task_menu() {
rm -rf "$TMPDIR"/task_list rm -rf "$TMPDIR"/task_list
;; ;;
3) 3)
line_break
if cat "$TMPDIR"/ShellCrash.log | grep -q '任务【'; then if cat "$TMPDIR"/ShellCrash.log | grep -q '任务【'; then
line_break
echo "==========================================================="
cat "$TMPDIR"/ShellCrash.log | grep '任务【' cat "$TMPDIR"/ShellCrash.log | grep '任务【'
echo "==========================================================="
else else
separator_line "=" msg_alert "\033[31m未找到任务相关执行日志\033[0m"
content_line "\033[31m未找到任务相关执行日志\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
4) 4)
line_break msg_alert "\033[36m请在日志工具中配置相关推送通道及推送开关\033[0m"
separator_line "="
content_line "\033[36m请在日志工具中配置相关推送通道及推送开关\033[0m"
separator_line "="
. "$CRASHDIR"/menus/8_tools.sh && log_pusher . "$CRASHDIR"/menus/8_tools.sh && log_pusher
;; ;;
5) 5)
@@ -527,7 +415,6 @@ task_menu() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done

View File

@@ -30,17 +30,18 @@ set_core_config() {
comp_box "\033[30;47m配置文件管理\033[0m" comp_box "\033[30;47m配置文件管理\033[0m"
[ -n "$list" ] && { [ -n "$list" ] && {
content_line "\033[36m输入数字可管理对应提供者\033[0m" content_line "\033[36m输入数字可管理对应提供者\033[0m"
content_line ""
list_box "$list" list_box "$list"
separator_line "-" separator_line "-"
} }
content_line "a) \033[32m添加提供者\033[0m(支持订阅/分享链接及本地文件)" btm_box "a) \033[32m添加提供者\033[0m支持订阅/分享链接及本地文件" \
content_line "b) \033[36m本地生成配置文件\033[0m(By Providers,推荐!)" "b) \033[36m本地生成配置文件\033[0m" \
content_line "c) \033[33m在线生成配置文件\033[0m(By Subconverter)" "c) \033[33m在线生成配置文件\033[0m" \
content_line "d) \033[31m清空提供者列表\033[0m" "d) \033[31m清空提供者列表\033[0m" \
content_line "e) \033[36m自定义配置文件\033[0m" "e) \033[36m自定义配置文件\033[0m" \
"" \
common_back "0) $COMMON_BACK"
read -r -p "$COMMON_INPUT_L > " num read -r -p "$COMMON_INPUT_L> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -58,7 +59,7 @@ set_core_config() {
. "$CRASHDIR"/menus/providers.sh . "$CRASHDIR"/menus/providers.sh
providers providers
else else
msg_alert "\033[33m仅限Mihomo/singboxr内核使用,请更换内核!\033[0m" msg_alert "\033[33m仅限Mihomosingboxr内核使用请更换内核!\033[0m"
fi fi
else else
msg_alert "请先添加提供者!" msg_alert "请先添加提供者!"
@@ -73,10 +74,12 @@ set_core_config() {
fi fi
;; ;;
d) d)
separator_line "=" comp_box "\033[33m警告这将删除所有提供者且无法还原\033[0m" \
content_line "\033[33m警告这将删除所有提供者且无法还原\033[0m" "" \
separator_line "-" "是否确认清空提供者列表:"
read -r -p "确认清空提供者列表?(1/0) > " res btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
rm -f "$CRASHDIR"/configs/providers.cfg rm -f "$CRASHDIR"/configs/providers.cfg
rm -f "$CRASHDIR"/configs/providers_uri.cfg rm -f "$CRASHDIR"/configs/providers_uri.cfg
@@ -84,21 +87,20 @@ set_core_config() {
} }
;; ;;
e) e)
checkcfg=$(cat $CFG_PATH) checkcfg=$(cat "$CFG_PATH")
. "$CRASHDIR"/menus/override.sh && override . "$CRASHDIR"/menus/override.sh && override
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
fi fi
;; ;;
*) *)
error_letter error_letter
break
;; ;;
esac esac
done done
} }
# 添加/管理提供者 # 添加/管理提供者
setproviders() { setproviders() {
case "$(echo "$@" | cut -d ' ' -f 2)" in case "$(echo "$@" | cut -d ' ' -f 2)" in
@@ -113,7 +115,7 @@ setproviders() {
include_w=${7#\#} include_w=${7#\#}
;; ;;
*://*) *://*)
set -- $line set -- $@
name=$1 name=$1
link_uri=$2 link_uri=$2
;; ;;
@@ -125,49 +127,62 @@ setproviders() {
[ -z "$interval" ] && interval=3 [ -z "$interval" ] && interval=3
[ -z "$interval2" ] && interval2=12 [ -z "$interval2" ] && interval2=12
[ -z "$ua" ] && ua='clash.meta' [ -z "$ua" ] && ua='clash.meta'
while true; do while true; do
link_info=$(echo "$link$link_uri" | cut -c 1-30) link_info=$(echo "$link$link_uri" | cut -c 1-30)
comp_box "\033[36m支持添加订阅链接/分享链接/本地文件作为提供者\033[0m" comp_box "\033[36m支持添加订阅链接/分享链接/本地文件作为提供者\033[0m"
content_line "1) 设置\033[36m名称或代号\033[0m \033[32m$name\033[0m" content_line "1) 设置\033[36m名称或代号\033[0m \033[32m$name\033[0m"
content_line "2) 设置\033[32m链接或路径\033[0m \033[36m$link_info...\033[0m" content_line "2) 设置\033[32m链接或路径\033[0m \033[36m$link_info\033[0m"
[ -n "$link" ] && [ -n "$link" ] &&
content_line "3) 设置\033[33m本地生成覆写\033[0m" content_line "3) 设置\033[33m本地生成覆写\033[0m"
separator_line "-" content_line ""
content_line "a) \033[36m保存此提供者\033[0m" content_line "a) \033[36m保存此提供者\033[0m"
content_line "d) \033[31m删除此提供者\033[0m"
content_line ""
content_line "\033[36m以下方式的详细配置请前往对应功能页面进行设置\033[0m"
[ -n "$link" ] && [ -n "$link" ] &&
content_line "b) \033[32m本地生成\033[0m仅包含此提供者的配置文件" content_line "b) \033[32m本地生成\033[0m仅包含此提供者的配置文件"
echo "$link$link_uri" | grep -q '://' && echo "$link$link_uri" | grep -q '://' &&
content_line "c) \033[33m在线生成\033[0m仅包含此提供者的配置文件" content_line "c) \033[33m在线生成\033[0m仅包含此提供者的配置文件"
echo "$link" | grep -q '^http' && echo "$link" | grep -q '^http' &&
content_line "e) 从此订阅链接直接拉取配置文件(不经过订阅转换)" content_line "e) 在线获取此配置文件(不使用订阅转换"
echo "$link" | grep -q '^./providers' && echo "$link" | grep -q '^./providers' &&
content_line "e) 直接使用此文件作为配置文件(不经过本地生成)" content_line "e) 直接使用此文件作为配置文件(不使用本地生成"
content_line "d) \033[31m删除此提供者\033[0m" btm_box "" \
common_back "0) $COMMON_BACK"
read -r -p "请输入对应字母或数字> " input read -r -p "请输入对应字母或数字> " input
case "$input" in case "$input" in
"" | 0) "" | 0)
break break
;; ;;
1) 1)
separator_line "=" while true; do
content_line "注意:不可重复,不支持纯数字,且不要超过4个汉字" comp_box "\033[33m注意\n名称或代号不可重复不支持纯数字且不要超过4个汉字\033[0m"
separator_line "-" btm_box "\033[36m请直接输入具体名称或代号\033[0m" \
read -r -p "输入具体名称或代号 > " text "输入 0 返回上级菜单"
text=$(printf "%.12s" "$text" | sed 's/ //g') #截断12字符+去空格 read -r -p "请输入> " text
if [ -n "$text" ] && [ -z "$(echo "$text" | grep -E '^[0-9]+$')" ] && ! grep -q "^$text " "$CRASHDIR"/configs/providers.cfg; then text=$(printf "%.12s" "$text" | sed 's/ //g') # 截断12字符+去空格
if [ "$text" = 0 ]; then
break
elif [ -n "$text" ] && [ -z "$(echo "$text" | grep -E '^[0-9]+$')" ] && ! grep -q "^$text " "$CRASHDIR"/configs/providers.cfg 2>/dev/null; then
name="$text" name="$text"
common_success
break
else else
error_input error_input
fi fi
done
;; ;;
2) 2)
separator_line "=" while true; do
content_line "\033[33m订阅链接\033[0m: https/http开头的clash配置文件订阅链接" comp_box "\033[33m订阅链接\033[0m\nhttps/http开头的clash配置文件订阅链接" \
content_line "\033[36m分享链接\033[0m: $URI_EXP" "" \
content_line "\033[33m本地文件\033[0m: 必须放在此目录下:\033[32m$CRASHDIR/providers\033[0m" "\033[36m分享链接\033[0m\n$URI_EXP" \
content_line "\033[36m Base64 \033[0m: 请直接写入本地文件" "" \
separator_line "-" "\033[33m本地文件\033[0m\n必须放在\033[32m$CRASHDIR/providers\033[0m目录下" \
"" \
"\033[36mBase64 \033[0m\n请直接写入本地文件"
list=$( list=$(
for f in "$CRASHDIR"/providers/*; do for f in "$CRASHDIR"/providers/*; do
[ "$f" = "$CRASHDIR"/providers/uri_group ] && continue [ "$f" = "$CRASHDIR"/providers/uri_group ] && continue
@@ -175,46 +190,56 @@ setproviders() {
printf '%s\n' "${f##*/}" printf '%s\n' "${f##*/}"
done | sort done | sort
) )
if [ -n "$list" ];then if [ -n "$list" ]; then
list_box "$list" list_box "$list"
separator_line "-" btm_box "" \
read -r -p "请选择对应文件或输入具体链接 > " text "输入 0 返回上级菜单"
read -r -p "请选择对应文件或输入具体链接> " text
else else
read -r -p "请输入具体链接 > " text btm_box "\033[36m请直接输入具体链接\033[0m" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " text
fi fi
text=$(echo "$text" | sed 's/ //g') #去空格 text=$(echo "$text" | sed 's/ //g') # 去空格
case "$text" in case "$text" in
0)
break
;;
http*) http*)
#处理订阅链接 # 处理订阅链接
text=$(echo "$text" | sed 's/ *(.*)//g; s/#.*//g') #处理注释及超链接 text=$(echo "$text" | sed 's/ *(.*)//g; s/#.*//g') # 处理注释及超链接
link="$text" link="$text"
link_uri='' link_uri=''
common_success common_success
break
;; ;;
[1-9] | [1-9][0-9]) [1-9] | [1-9][0-9])
#处理本地文件 # 处理本地文件
file=$(printf '%s\n' "$list" | sed -n "${text}p") file=$(printf '%s\n' "$list" | sed -n "${text}p")
if [ -s "$CRASHDIR/providers/$file" ]; then if [ -s "$CRASHDIR/providers/$file" ]; then
link="./providers/$file" link="./providers/$file"
[ -z "$name" ] && name="_$(printf "%.12s" "$file" | sed 's/ //g')" [ -z "$name" ] && name="_$(printf "%.12s" "$file" | sed 's/ //g')"
link_uri='' link_uri=''
common_success common_success
break
else else
errornum errornum
fi fi
;; ;;
*) *)
#处理分享链接 # 处理分享链接
if [ -n "$(echo $text | grep -E "^$URI_EXP")" ]; then if [ -n "$(echo "$text" | grep -E "^$URI_EXP")" ]; then
link_uri=$(echo "$text" | sed 's/#.*//g') # 删除注释 link_uri=$(echo "$text" | sed 's/#.*//g') # 删除注释
link='' link=''
[ -z "$name" ] && name=$(printf '%b' "$(printf '%s' "$text" | sed 's/+/ /g; s/%/\\x/g')" | sed 's/.*#//') [ -z "$name" ] && name=$(printf '%b' "$(printf '%s' "$text" | sed 's/+/ /g; s/%/\\x/g')" | sed 's/.*#//')
common_success common_success
break
else else
error_input error_input
fi fi
;; ;;
esac esac
done
;; ;;
3) 3)
custproviders custproviders
@@ -229,38 +254,40 @@ setproviders() {
. "$CRASHDIR/menus/providers_$CORE_TYPE.sh" . "$CRASHDIR/menus/providers_$CORE_TYPE.sh"
gen_providers "$name" "$link" "$interval" "$interval2" "$ua" "#$exclude_w" "#$include_w" gen_providers "$name" "$link" "$interval" "$interval2" "$ua" "#$exclude_w" "#$include_w"
else else
content_line "\033[31m$请先完成必填选项!\033[0m" msg_alert "\033[31m$请先完成必填选项!\033[0m"
fi fi
;; ;;
c) c)
if [ -n "$name" ] && [ -n "$link$link_uri" ]; then if [ -n "$name" ] && [ -n "$link$link_uri" ]; then
saveproviders saveproviders
[ -n "$link" ] && Url="$link" [ -n "$link" ] && Url="$link"
[ -n "$link_uri" ] && Url=$(echo "$name $link_uri" |awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }') [ -n "$link_uri" ] && Url=$(echo "$name $link_uri" | awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }')
Https='' Https=''
setconfig Url "'$Url'" setconfig Url "'$Url'"
setconfig Https setconfig Https
# 获取在线文件 # 获取在线文件
jump_core_config jump_core_config
else else
content_line "\033[31m请先完成必填选项\033[0m" msg_alert "\033[31m请先完成必填选项\033[0m"
fi fi
;; ;;
d) d)
if [ -n "$name" ] && [ -n "$link" ]; then if [ -n "$name" ] && [ -n "$link" ]; then
sed -i "/^$name /d" "$CRASHDIR"/configs/providers.cfg sed -i "/^$name /d" "$CRASHDIR"/configs/providers.cfg 2>/dev/null
content_line "\033[32m$COMMON_SUCCESS\033[0m" msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
elif [ -n "$name" ] && [ -n "$link_uri" ]; then elif [ -n "$name" ] && [ -n "$link_uri" ]; then
sed -i "/^$name /d" "$CRASHDIR"/configs/providers_uri.cfg sed -i "/^$name /d" "$CRASHDIR"/configs/providers_uri.cfg 2>/dev/null
content_line "\033[32m$COMMON_SUCCESS\033[0m" msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
fi fi
break break
;; ;;
e) e)
if [ -n "$link" ]; then if [ -n "$link" ]; then
content_line "注意:\033[31m此功能不兼容“跳过证书验证”功能\033[0m" comp_box "\033[31m注意:\n此功能不兼容“跳过证书验证”功能\033[0m" \
content_line "\033[31m请确认你完全理解自己在做什么\033[0m" "\033[31m请确认你完全理解自己在做什么\033[0m"
read -p "我确认遇到问题可以自行解决(1/0) > " res btm_box "1) 我确认遇到问题可以自行解决" \
"0) 返回上级菜单"
read -r -p "$COMMON_INPUT> " res
[ "$res" = "1" ] && { [ "$res" = "1" ] && {
file=$(echo "$CRASHDIR/$link" | sed 's|\./||') file=$(echo "$CRASHDIR/$link" | sed 's|\./||')
if [ -f "$file" ]; then if [ -f "$file" ]; then
@@ -278,22 +305,21 @@ setproviders() {
jump_core_config jump_core_config
break break
else else
content_line "\033[31m请先完成必填选项\033[0m" msg_alert "\033[31m请先完成必填选项\033[0m"
fi fi
} }
else else
content_line "\033[31m请先完成必填选项\033[0m" msg_alert "\033[31m请先完成必填选项\033[0m"
sleep 1
fi fi
;; ;;
*) *)
error_letter error_letter
break
;; ;;
esac esac
done done
} }
#保存
# 保存
saveproviders() { saveproviders() {
[ -n "$name" ] && { [ -n "$name" ] && {
[ -s "$CRASHDIR"/configs/providers.cfg ] && sed -i "/^$last_name /d" "$CRASHDIR"/configs/providers.cfg [ -s "$CRASHDIR"/configs/providers.cfg ] && sed -i "/^$last_name /d" "$CRASHDIR"/configs/providers.cfg
@@ -310,87 +336,154 @@ saveproviders() {
return 1 return 1
fi fi
} }
#本地生成覆写
# 本地生成覆写
custproviders() { custproviders() {
while true; do while true; do
separator_line '-' top_box "1) 设置\033[33m健康检查间隔\033[0m\t\033[47;30m$interval\033[0m 分钟" \
content_line "1) 设置\033[33m健康检查间隔\033[0m\t\033[47;30m$interval\033[0m" "2) 设置\033[36m自动更新间隔\033[0m\t\033[47;30m$interval2\033[0m 小时"
content_line "2) 设置\033[36m自动更新间隔\033[0m\t\033[47;30m$interval2\033[0m"
echo "$link" | grep -q '^http' && echo "$link" | grep -q '^http' &&
content_line "3) 设置\033[33m虚拟浏览器UA\033[0m\t\033[47;30m$ua\033[0m" content_line "3) 设置\033[33m虚拟浏览器UA\033[0m\t\033[47;30m$ua\033[0m"
content_line "4) 设置\033[31m排除节点正则\033[0m\t\033[47;30m$exclude_w\033[0m" btm_box "4) 设置\033[31m排除节点正则\033[0m\t\033[47;30m$exclude_w\033[0m" \
content_line "5) 设置\033[32m包含节点正则\033[0m\t\033[47;30m$include_w\033[0m" "5) 设置\033[32m包含节点正则\033[0m\t\033[47;30m$include_w\033[0m" \
common_back "" \
"0) $COMMON_BACK"
read -r -p "请输入对应数字> " num read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
1) 1)
read -p "请输入健康检查间隔(单位:分钟) > " num while true; do
if [ -n "$num" ]; then comp_box "当前健康检查间隔:$interval 分钟"
btm_box "\033[36m请直接健康检查间隔单位分钟\033[0m" \
"或输入 r 重置健康检查间隔为默认值3 分钟)" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " num
if [ "$num" = "r" ]; then
interval=3
elif [ -n "$num" ] && [ "$num" -eq "$num" ] 2>/dev/null; then
interval="$num" interval="$num"
else else
errornum errornum
continue
fi fi
common_success
break
done
;; ;;
2) 2)
read -p "请输入自动更新间隔(单位:小时) > " num while true; do
if [ -n "$num" ]; then comp_box "当前健康检查间隔:$interval 分钟"
btm_box "\033[36m请直接输入自动更新间隔单位小时\033[0m" \
"或输入 r 重置自动更新间隔为默认值12 小时)" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " num
if [ "$num" = "r" ]; then
interval2=12
elif [ -n "$num" ] && [ "$num" -eq "$num" ] 2>/dev/null; then
interval2="$num" interval2="$num"
else else
errornum errornum
continue
fi fi
common_success
break
done
;; ;;
3) 3)
read -p "请输入浏览器UA(输入0重置) > " text if [ -z "$ua" ]; then
comp_box "当前浏览器UA无"
else
comp_box "当前浏览器UA$ua"
fi
btm_box "\033[36m请直接输入浏览器UA\033[0m" \
"或输入 r 重置浏览器UA为默认值clash.meta" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " text
case "$text" in case "$text" in
0) 0)
include_w='clash.meta' continue
;;
r)
ua='clash.meta'
;; ;;
*) *)
include_w="$text" ua="$text"
;; ;;
esac esac
common_success
;; ;;
4) 4)
read -p "请输入需要排除的节点关键字(支持正则,不支持空格,输入0删除) > " text if [ -z "$exclude_w" ]; then
text=$(echo "$text" | sed 's/ //g') #去空格 comp_box "当前排除规则:无"
else
comp_box "当前排除规则:$exclude_w"
fi
btm_box "\033[36m请直接输入需要排除的节点关键字支持正则不支持空格\033[0m" \
"或输入 c 清空排除规则" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " text
text=$(echo "$text" | sed 's/ //g') # 去空格
case "$text" in case "$text" in
0) 0)
continue
;;
c)
exclude_w='' exclude_w=''
;; ;;
*) *)
exclude_w="$text" exclude_w="$text"
;; ;;
esac esac
common_success
;; ;;
5) 5)
read -p "请输入需要筛选使用的节点关键字(支持正则,不支持空格,输入0删除) > " text if [ -z "$include_w" ]; then
text=$(echo "$text" | sed 's/ //g') #去空格 comp_box "当前包含规则:无"
else
comp_box "当前包含规则:$include_w"
fi
btm_box "\033[36m请直接输入需要包含的节点关键字支持正则不支持空格\033[0m" \
"或输入 c 清空包含规则" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " text
text=$(echo "$text" | sed 's/ //g') # 去空格
case "$text" in case "$text" in
0) 0)
continue
;;
c)
include_w='' include_w=''
;; ;;
*) *)
include_w="$text" include_w="$text"
;; ;;
esac esac
common_success
;; ;;
*) *)
error_letter error_letter
break
;; ;;
esac esac
done done
} }
# 调用工具在线获取配置文件 # 调用工具在线获取配置文件
jump_core_config() { jump_core_config() {
. "$CRASHDIR"/starts/core_config.sh && get_core_config . "$CRASHDIR"/starts/core_config.sh && get_core_config
if [ "$?" = 0 ]; then if [ "$?" = 0 ]; then
if [ "$inuserguide" != 1 ]; then if [ "$inuserguide" != 1 ]; then
read -p "是否启动服务以使配置文件生效(1/0) > " res comp_box "是否启动服务以使配置文件生效"
[ "$res" = 1 ] && start_core || main_menu btm_box "1) 是" \
"0) 否"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = 1 ]; then
start_core
else
main_menu
fi
exit exit
fi fi
fi fi

View File

@@ -11,10 +11,7 @@ __IS_MODULE_7_GATEWAY_LOADED=1
# 访问与控制主菜单 # 访问与控制主菜单
gateway() { gateway() {
while true; do while true; do
line_break comp_box "\033[30;47m访问与控制菜单\033[0m"
separator_line "="
content_line "\033[30;47m访问与控制\033[0m"
separator_line "="
content_line "1) 配置\033[33m公网访问防火墙 \033[32m$fw_wan\033[0m" content_line "1) 配置\033[33m公网访问防火墙 \033[32m$fw_wan\033[0m"
content_line "2) 配置\033[36mTelegram专属控制机器人 \033[32m$bot_tg_service\033[0m" content_line "2) 配置\033[36mTelegram专属控制机器人 \033[32m$bot_tg_service\033[0m"
content_line "3) 配置\033[36mDDNS自动域名\033[0m" content_line "3) 配置\033[36mDDNS自动域名\033[0m"
@@ -24,23 +21,19 @@ gateway() {
content_line "6) 配置\033[36mTailscale内网穿透\033[0m限Singbox \033[32m$ts_service\033[0m" content_line "6) 配置\033[36mTailscale内网穿透\033[0m限Singbox \033[32m$ts_service\033[0m"
content_line "7) 配置\033[36mWireguard客户端\033[0m限Singbox \033[32m$wg_service\033[0m" content_line "7) 配置\033[36mWireguard客户端\033[0m限Singbox \033[32m$wg_service\033[0m"
} }
content_line "0) 返回上级菜单" btm_box "" \
separator_line "=" "0) 返回上级菜单"
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
1) 1)
line_break
separator_line "="
if [ -n "$(pidof CrashCore)" ] && [ "$firewall_mod" = 'iptables' ]; then if [ -n "$(pidof CrashCore)" ] && [ "$firewall_mod" = 'iptables' ]; then
content_line "\033[33m公网访问防火墙需要先停止服务\033[0m" comp_box "\033[33m公网访问防火墙需要先停止服务\033[0m" \
content_line "是否确认继续" "是否确认继续"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
"$CRASHDIR"/start.sh stop && set_fw_wan "$CRASHDIR"/start.sh stop && set_fw_wan
@@ -67,27 +60,18 @@ gateway() {
if echo "$crashcore" | grep -q 'sing'; then if echo "$crashcore" | grep -q 'sing'; then
set_tailscale set_tailscale
else else
line_break msg_alert "\033[33m$crashcore内核暂不支持此功能,请先更换内核!\033[0m"
separator_line "="
content_line "\033[33m$crashcore内核暂不支持此功能,请先更换内核!\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
7) 7)
if echo "$crashcore" | grep -q 'sing'; then if echo "$crashcore" | grep -q 'sing'; then
set_wireguard set_wireguard
else else
line_break msg_alert "\033[33m$crashcore内核暂不支持此功能,请先更换内核!\033[0m"
separator_line "="
content_line "\033[33m$crashcore内核暂不支持此功能,请先更换内核!\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -106,12 +90,12 @@ set_fw_wan() {
content_line "当前自动放行端口:\033[36m$vms_port $sss_port\033[0m" content_line "当前自动放行端口:\033[36m$vms_port $sss_port\033[0m"
content_line "默认拦截端口:\033[33m$mix_port,$db_port\033[0m" content_line "默认拦截端口:\033[33m$mix_port,$db_port\033[0m"
separator_line "=" separator_line "="
content_line "1) 启用/关闭公网防火墙:\033[36m$fw_wan\033[0m" btm_box "1) 启用/关闭公网防火墙:\033[36m$fw_wan\033[0m" \
content_line "2) 添加放行端口(可包含默认拦截端口)" "2) 添加放行端口(可包含默认拦截端口)" \
content_line "3) 移除指定手动放行端口" "3) 移除指定手动放行端口" \
content_line "4) 清空全部手动放行端口" "4) 清空全部手动放行端口" \
content_line "0) 返回上级菜单" "" \
separator_line "=" "0) 返回上级菜单"
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case $num in case $num in
"" | 0) "" | 0)
@@ -119,14 +103,10 @@ set_fw_wan() {
;; ;;
1) 1)
if [ "$fw_wan" = ON ]; then if [ "$fw_wan" = ON ]; then
line_break comp_box "是否确认关闭防火墙?" \
separator_line "=" "这会带来极大的安全隐患!"
content_line "是否确认关闭防火墙?" btm_box "1) 是" \
content_line "这会带来极大的安全隐患!" "0) 否,返回上级菜单"
separator_line "="
content_line "1) 是"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
fw_wan=OFF fw_wan=OFF
@@ -139,77 +119,55 @@ set_fw_wan() {
setconfig fw_wan "$fw_wan" setconfig fw_wan "$fw_wan"
;; ;;
2) 2)
line_break
port_count=$(echo "$fw_wan_ports" | awk -F',' '{print NF}') port_count=$(echo "$fw_wan_ports" | awk -F',' '{print NF}')
if [ "$port_count" -ge 10 ]; then if [ "$port_count" -ge 10 ]; then
separator_line "=" msg_alert "\033[31m最多支持设置放行10个端口请先减少一些\033[0m"
content_line "\033[31m最多支持设置放行10个端口请先减少一些\033[0m"
separator_line "="
else else
line_break
read -r -p "请输入要放行的端口号> " port read -r -p "请输入要放行的端口号> " port
if echo ",$fw_wan_ports," | grep -q ",$port,"; then if echo ",$fw_wan_ports," | grep -q ",$port,"; then
line_break msg_alert "\033[31m输入错误请勿重复添加\033[0m"
separator_line "="
content_line "\033[31m输入错误请勿重复添加\033[0m"
separator_line "="
elif [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then elif [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then
line_break msg_alert "\033[31m输入错误请输入正确的数值(1-65535)\033[0m"
separator_line "="
content_line "\033[31m输入错误请输入正确的数值(1-65535)\033[0m"
separator_line "="
else else
fw_wan_ports=$(echo "$fw_wan_ports,$port" | sed "s/^,//") fw_wan_ports=$(echo "$fw_wan_ports,$port" | sed "s/^,//")
setconfig fw_wan_ports "$fw_wan_ports" if setconfig fw_wan_ports "$fw_wan_ports"; then
common_success
else
common_faileds
fi
fi fi
fi fi
sleep 1
;; ;;
3) 3)
while true; do while true; do
line_break comp_box "\033[36m请直接输入要移除的端口号\033[0m" \
separator_line "=" "或输入 0 返回上级菜单"
content_line "请直接输入要移除的端口号"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " port read -r -p "请输入> " port
if [ "$port" = 0 ]; then if [ "$port" = 0 ]; then
break break
elif echo ",$fw_wan_ports," | grep -q ",$port,"; then elif echo ",$fw_wan_ports," | grep -q ",$port,"; then
if [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then if [ "$port" -lt 1 ] || [ "$port" -gt 65535 ]; then
line_break msg_alert "\033[31m输入错误\033[0m" \
separator_line "=" "\033[31m请输入正确的数值(1-65535)\033[0m"
content_line "\033[31m输入错误\033[0m"
content_line "\033[31m请输入正确的数值(1-65535)\033[0m"
separator_line "="
sleep 1
else else
fw_wan_ports=$(echo ",$fw_wan_ports," | sed "s/,$port//; s/^,//; s/,$//") fw_wan_ports=$(echo ",$fw_wan_ports," | sed "s/,$port//; s/^,//; s/,$//")
setconfig fw_wan_ports "$fw_wan_ports" setconfig fw_wan_ports "$fw_wan_ports"
break break
fi fi
else else
line_break msg_alert "\033[31m输入错误\033[0m" \
separator_line "=" "\033[31m请输入已添加过的端口\033[0m"
content_line "\033[31m输入错误\033[0m"
content_line "\033[31m请输入已添加过的端口\033[0m"
separator_line "="
sleep 1
fi fi
done done
;; ;;
4) 4)
fw_wan_ports='' fw_wan_ports=''
setconfig fw_wan_ports setconfig fw_wan_ports
msg_alert "\033[32m操作成功\033[0m"
line_break
separator_line "="
content_line "\033[32m操作成功\033[0m"
separator_line "="
sleep 1
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -236,10 +194,7 @@ EOF
web_json_post "$bot_api/setMyCommands" "$JSON" web_json_post "$bot_api/setMyCommands" "$JSON"
web_json_post "$bot_api/sendMessage" '{"chat_id":"'"$chat_ID"'","text":"'"$TEXT"'","parse_mode":"Markdown"}' web_json_post "$bot_api/sendMessage" '{"chat_id":"'"$chat_ID"'","text":"'"$TEXT"'","parse_mode":"Markdown"}'
line_break comp_box "\033[32m$TEXT\033[0m"
separator_line "="
content_line "\033[32m$TEXT\033[0m"
separator_line "="
} }
set_bot_tg_init() { set_bot_tg_init() {
@@ -258,7 +213,8 @@ set_bot_tg_service() {
. "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop
else else
bot_tg_service=ON bot_tg_service=ON
[ -n "$(pidof CrashCore)" ] && . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_start [ -n "$(pidof CrashCore)" ] && . "$CRASHDIR"/menus/bot_tg_service.sh &&
bot_tg_start && bot_tg_cron
fi fi
setconfig bot_tg_service "$bot_tg_service" setconfig bot_tg_service "$bot_tg_service"
} }
@@ -267,14 +223,12 @@ set_bot_tg() {
while true; do while true; do
[ -n "$ts_auth_key" ] && ts_auth_key_info='已设置' [ -n "$ts_auth_key" ] && ts_auth_key_info='已设置'
[ -n "$TG_CHATID" ] && TG_CHATID_info='已绑定' [ -n "$TG_CHATID" ] && TG_CHATID_info='已绑定'
line_break comp_box "\033[31m注意\033[0m由于网络环境原因此机器人仅限服务启动时运行"
separator_line "=" btm_box "1) 启用关闭TG-BOT服务 \033[32m$bot_tg_service\033[0m" \
content_line "\033[31m注意\033[0m由于网络环境原因此机器人仅限服务启动时运行" "2) TG-BOT绑定设置 \033[32m$TG_CHATID_info\033[0m" \
separator_line "=" "3) 启动时推送菜单 \033[32m$TG_menupush\033[0m" \
content_line "1) 启用关闭TG-BOT服务 \033[32m$bot_tg_service\033[0m" "" \
content_line "2) TG-BOT绑定设置 \033[32m$TG_CHATID_info\033[0m" "0) 返回上级菜单"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -285,23 +239,15 @@ set_bot_tg() {
if [ -n "$TG_CHATID" ]; then if [ -n "$TG_CHATID" ]; then
set_bot_tg_service set_bot_tg_service
else else
line_break msg_alert "\033[31m请先绑定TG-BOT\033[0m"
separator_line "="
content_line "\033[31m请先绑定TG-BOT\033[0m"
separator_line "="
fi fi
sleep 1
;; ;;
2) 2)
if [ -n "$chat_ID" ] && [ -n "$push_TG" ] && [ "$push_TG" != 'publictoken' ]; then if [ -n "$chat_ID" ] && [ -n "$push_TG" ] && [ "$push_TG" != 'publictoken' ]; then
line_break comp_box "检测到已经绑定了TG推送BOT" \
separator_line "=" "是否直接使用?"
content_line "检测到已经绑定了TG推送BOT" btm_box "1) 是" \
content_line "是否直接使用:" "0) 否"
separator_line "="
content_line "1) 是"
content_line "0) 否"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
TOKEN="$push_TG" TOKEN="$push_TG"
@@ -311,9 +257,17 @@ set_bot_tg() {
fi fi
set_bot_tg_init set_bot_tg_init
;; ;;
3)
if [ "$TG_menupush" = ON ];then
TG_menupush=OFF
else
TG_menupush=ON
fi
setconfig TG_menupush "$TG_menupush" "$GT_CFG_PATH"
set_bot_tg
;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -322,13 +276,10 @@ set_bot_tg() {
# 自定义入站 # 自定义入站
set_vmess() { set_vmess() {
while true; do while true; do
line_break comp_box "\033[31m注意\033[0m" \
separator_line "=" "设置的端口会添加到公网访问防火墙并自动放行!" \
content_line "\033[31m注意\033[0m" "脚本只提供基础功能,更多需求请用自定义配置文件功能!" \
content_line "设置的端口会添加到公网访问防火墙并自动放行!" "\033[31m切勿用于搭建违法翻墙节点违者后果自负\033[0m"
content_line "脚本只提供基础功能,更多需求请用自定义配置文件功能!"
content_line "\033[31m切勿用于搭建违法翻墙节点违者后果自负\033[0m"
separator_line "="
content_line "1) \033[32m启用/关闭\033[0mVmess入站 \033[32m$vms_service\033[0m" content_line "1) \033[32m启用/关闭\033[0mVmess入站 \033[32m$vms_service\033[0m"
content_line "2) 设置\033[36m监听端口\033[0m \033[36m$vms_port\033[0m" content_line "2) 设置\033[36m监听端口\033[0m \033[36m$vms_port\033[0m"
content_line "3) 设置\033[33mWS-path可选\033[0m \033[33m$vms_ws_path\033[0m" content_line "3) 设置\033[33mWS-path可选\033[0m \033[33m$vms_ws_path\033[0m"
@@ -336,9 +287,9 @@ set_vmess() {
content_line "5) 一键生成\033[32m随机秘钥\033[0m" content_line "5) 一键生成\033[32m随机秘钥\033[0m"
gen_base64 1 >/dev/null 2>&1 && gen_base64 1 >/dev/null 2>&1 &&
content_line "6) 设置\033[36m混淆host可选\033[0m \033[33m$vms_host\033[0m" content_line "6) 设置\033[36m混淆host可选\033[0m \033[33m$vms_host\033[0m"
content_line "7) 一键生成\033[32m分享链接\033[0m" btm_box "7) 一键生成\033[32m分享链接\033[0m" \
content_line "0) 返回上级菜单" "" \
separator_line "=" "0) 返回上级菜单"
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -353,11 +304,7 @@ set_vmess() {
vms_service=ON vms_service=ON
setconfig vms_service "$vms_service" setconfig vms_service "$vms_service"
else else
line_break msg_alert "\033[31m请先完成必选设置\033[0m"
separator_line "="
content_line "\033[31m请先完成必选设置\033[0m"
separator_line "="
sleep 1
fi fi
fi fi
;; ;;
@@ -384,11 +331,7 @@ set_vmess() {
vms_ws_path="$text" vms_ws_path="$text"
setconfig vms_ws_path "$text" "$GT_CFG_PATH" setconfig vms_ws_path "$text" "$GT_CFG_PATH"
else else
line_break msg_alert "\033[31m不是合法的path路径必须以【/】开头!\033[0m"
separator_line "="
content_line "\033[31m不是合法的path路径必须以【/】开头!\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
4) 4)
@@ -401,11 +344,7 @@ set_vmess() {
vms_uuid="$text" vms_uuid="$text"
setconfig vms_uuid "$text" "$GT_CFG_PATH" setconfig vms_uuid "$text" "$GT_CFG_PATH"
else else
line_break msg_alert "\033[31m不是合法的UUID格式请重新输入或使用随机生成功能\033[0m"
separator_line "="
content_line "\033[31m不是合法的UUID格式请重新输入或使用随机生成功能\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
5) 5)
@@ -448,17 +387,13 @@ EOF
vms_link="vmess://$(gen_base64 "$vms_json")" vms_link="vmess://$(gen_base64 "$vms_json")"
line_break line_break
echo -e "你的分享链接是(请勿随意分享给他人):\n\033[32m$vms_link\033[0m" echo -e "你的分享链接是(请勿随意分享给他人):\n\033[32m$vms_link\033[0m"
else
line_break
separator_line "="
content_line "\033[31m请先完成必选设置\033[0m"
separator_line "="
fi
sleep 1 sleep 1
else
msg_alert "\033[31m请先完成必选设置\033[0m"
fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -466,21 +401,18 @@ EOF
set_shadowsocks() { set_shadowsocks() {
while true; do while true; do
line_break comp_box "\033[31m注意\033[0m" \
separator_line "=" "设置的端口会添加到公网访问防火墙并自动放行!" \
content_line "\033[31m注意\033[0m" "脚本只提供基础功能,更多需求请用自定义配置文件功能!" \
content_line "设置的端口会添加到公网访问防火墙并自动放行!" "\033[31m切勿用于搭建违法翻墙节点违者后果自负\033[0m"
content_line "脚本只提供基础功能,更多需求请用自定义配置文件功能!"
content_line "\033[31m切勿用于搭建违法翻墙节点违者后果自负\033[0m"
separator_line "="
content_line "1) \033[32m启用/关闭\033[0mShadowSocks入站 \033[32m$sss_service\033[0m" content_line "1) \033[32m启用/关闭\033[0mShadowSocks入站 \033[32m$sss_service\033[0m"
content_line "2) 设置\033[36m监听端口\033[0m \033[36m$sss_port\033[0m" content_line "2) 设置\033[36m监听端口\033[0m \033[36m$sss_port\033[0m"
content_line "3) 选择\033[33m加密协议\033[0m \033[33m$sss_cipher\033[0m" content_line "3) 选择\033[33m加密协议\033[0m \033[33m$sss_cipher\033[0m"
content_line "4) 设置\033[36mpassword\033[0m \033[36m$sss_pwd\033[0m" content_line "4) 设置\033[36mpassword\033[0m \033[36m$sss_pwd\033[0m"
gen_base64 1 >/dev/null 2>&1 && gen_base64 1 >/dev/null 2>&1 &&
content_line "5) 一键生成分享链接" content_line "5) 一键生成分享链接"
content_line "0) 返回上级菜单" btm_box "" \
separator_line "=" "0) 返回上级菜单"
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -495,11 +427,7 @@ set_shadowsocks() {
sss_service=ON sss_service=ON
setconfig sss_service "$sss_service" setconfig sss_service "$sss_service"
else else
line_break msg_alert "\033[31m请先完成必选设置\033[0m"
separator_line "="
content_line "\033[31m请先完成必选设置\033[0m"
separator_line "="
sleep 1
fi fi
fi fi
;; ;;
@@ -517,10 +445,7 @@ set_shadowsocks() {
fi fi
;; ;;
3) 3)
line_break comp_box "请选择要使用的加密协议:"
separator_line "="
content_line "请选择要使用的加密协议:"
separator_line "="
content_line "1) \033[32mxchacha20-ietf-poly1305\033[0m" content_line "1) \033[32mxchacha20-ietf-poly1305\033[0m"
content_line "2) \033[32mchacha20-ietf-poly1305\033[0m" content_line "2) \033[32mchacha20-ietf-poly1305\033[0m"
content_line "3) \033[32maes-128-gcm\033[0m" content_line "3) \033[32maes-128-gcm\033[0m"
@@ -533,9 +458,8 @@ set_shadowsocks() {
content_line "6) \033[32m2022-blake3-aes-128-gcm\033[0m" content_line "6) \033[32m2022-blake3-aes-128-gcm\033[0m"
content_line "7) \033[32m2022-blake3-aes-256-gcm\033[0m" content_line "7) \033[32m2022-blake3-aes-256-gcm\033[0m"
} }
content_line "" btm_box "" \
content_line "0) 返回上级菜单" "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
0) ;; 0) ;;
@@ -569,20 +493,16 @@ set_shadowsocks() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
setconfig sss_cipher "$sss_cipher" "$GT_CFG_PATH" setconfig sss_cipher "$sss_cipher" "$GT_CFG_PATH"
setconfig sss_pwd "$sss_pwd" "$GT_CFG_PATH" setconfig sss_pwd "$sss_pwd" "$GT_CFG_PATH"
;; ;;
4) 4)
line_break
if echo "$sss_cipher" | grep -q '2022-blake3'; then if echo "$sss_cipher" | grep -q '2022-blake3'; then
separator_line "=" msg_alert "\033[31m注意\033[0m2022系列加密必须使用脚本随机生成的password"
content_line "\033[31m注意\033[0m2022系列加密必须使用脚本随机生成的password"
separator_line "="
sleep 1
else else
line_break
read -r -p "请输入秘钥输入0删除> " text read -r -p "请输入秘钥输入0删除> " text
[ "$text" = 0 ] && sss_pwd='' || sss_pwd="$text" [ "$text" = 0 ] && sss_pwd='' || sss_pwd="$text"
setconfig sss_pwd "$text" "$GT_CFG_PATH" setconfig sss_pwd "$text" "$GT_CFG_PATH"
@@ -595,17 +515,13 @@ set_shadowsocks() {
ss_link="ss://$(gen_base64 "$sss_cipher":"$sss_pwd")@${text}:${sss_port}#ShellCrash_ss_in" ss_link="ss://$(gen_base64 "$sss_cipher":"$sss_pwd")@${text}:${sss_port}#ShellCrash_ss_in"
line_break line_break
echo -e "你的分享链接是(请勿随意分享给他人):\n\033[32m$ss_link\033[0m" echo -e "你的分享链接是(请勿随意分享给他人):\n\033[32m$ss_link\033[0m"
else
line_break
separator_line "="
content_line "\033[31m请先完成必选设置\033[0m"
separator_line "="
fi
sleep 1 sleep 1
else
msg_alert "\033[31m请先完成必选设置\033[0m"
fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -615,20 +531,17 @@ set_shadowsocks() {
set_tailscale() { set_tailscale() {
while true; do while true; do
[ -n "$ts_auth_key" ] && ts_auth_key_info='*********' [ -n "$ts_auth_key" ] && ts_auth_key_info='*********'
line_break comp_box "\033[31m注意\033[0m脚本默认内核为了节约内存没有编译Tailscale模块\n如需使用请先前往自定义内核更新完整版内核文件" \
separator_line "=" "创建秘钥:\033[32;4mhttps://login.tailscale.com/admin/settings/keys\033[0m" \
content_line "\033[31m注意\033[0m脚本默认内核为了节约内存没有编译Tailscale模块\n如需使用请先前往自定义内核更新完整版内核文件" "访问非本机目标需允许通告:\033[32;4mhttps://login.tailscale.com\033[0m" \
content_line "创建秘钥:\033[32;4mhttps://login.tailscale.com/admin/settings/keys\033[0m" "访问非本机目标需在终端设置使用Subnet或EXIT-NODE模式"
content_line "访问非本机目标需允许通告:\033[32;4mhttps://login.tailscale.com\033[0m" btm_box "1) \033[32m启用/关闭\033[0mTailscale服务 \033[32m$ts_service\033[0m" \
content_line "访问非本机目标需在终端设置使用Subnet或EXIT-NODE模式" "2) 设置\033[36m秘钥\033[0mAuth Key $ts_auth_key_info" \
separator_line "=" "3) 通告路由\033[33m内网地址\033[0mSubnet \033[36m$ts_subnet\033[0m" \
content_line "1) \033[32m启用/关闭\033[0mTailscale服务 \033[32m$ts_service\033[0m" "4) 通告路由\033[31m全部流量\033[0mEXIT-NODE \033[36m$ts_exit_node\033[0m" \
content_line "2) 设置\033[36m秘钥\033[0mAuth Key $ts_auth_key_info" "5) 设置\033[36m设备名称\033[0m可选 $ts_hostname" \
content_line "3) 通告路由\033[33m内网地址\033[0mSubnet \033[36m$ts_subnet\033[0m" "" \
content_line "4) 通告路由\033[31m全部流量\033[0mEXIT-NODE \033[36m$ts_exit_node\033[0m" "0) 返回上级菜单"
content_line "5) 设置\033[36m设备名称\033[0m可选 $ts_hostname"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -639,11 +552,7 @@ set_tailscale() {
[ "$ts_service" = ON ] && ts_service=OFF || ts_service=ON [ "$ts_service" = ON ] && ts_service=OFF || ts_service=ON
setconfig ts_service "$ts_service" setconfig ts_service "$ts_service"
else else
line_break msg_alert "\033[31m请先设置秘钥\033[0m"
separator_line "="
content_line "\033[31m请先设置秘钥\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
2) 2)
@@ -661,20 +570,13 @@ set_tailscale() {
ts_exit_node=false ts_exit_node=false
else else
ts_exit_node=true ts_exit_node=true
line_break msg_alert -t 3 "\033[31m注意\033[0m目前exitnode的官方DNS有bug要么启用域名嗅探并禁用TailscaleDNS\n要么必须在网页设置Globalname servers为分配的本设备子网IP且启用override"
separator_line "="
content_line "\033[31m注意\033[0m目前exitnode的官方DNS有bug要么启用域名嗅探并禁用TailscaleDNS\n要么必须在网页设置Globalname servers为分配的本设备子网IP且启用override"
separator_line "="
sleep 3
fi fi
setconfig ts_exit_node "$ts_exit_node" "$GT_CFG_PATH" setconfig ts_exit_node "$ts_exit_node" "$GT_CFG_PATH"
;; ;;
5) 5)
line_break comp_box "\033[36m请直接输入希望在Tailscale显示的设备名称\033[0m" \
separator_line "=" "或输入 0 返回上级菜单"
content_line "请直接输入希望在Tailscale显示的设备名称"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " ts_hostname read -r -p "请输入> " ts_hostname
if [ "$ts_hostname" != 0 ]; then if [ "$ts_hostname" != 0 ]; then
setconfig ts_hostname "$ts_hostname" "$GT_CFG_PATH" setconfig ts_hostname "$ts_hostname" "$GT_CFG_PATH"
@@ -682,7 +584,6 @@ set_tailscale() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -708,24 +609,19 @@ set_wireguard() {
else else
unset wgpsk_key_info unset wgpsk_key_info
fi fi
comp_box "\033[31m注意\033[0m脚本默认内核为了节约内存没有编译WireGuard模块\n如需使用请先前往自定义内核更新完整版内核文件"
line_break btm_box "1) \033[32m启用/关闭\033[0mWireguard服务 \033[32m$wg_service\033[0m" \
separator_line "=" "" \
content_line "\033[31m注意\033[0m脚本默认内核为了节约内存没有编译WireGuard模块\n如需使用请先前往自定义内核更新完整版内核文件" "2) 设置\033[36mEndpoint地址\033[0m \033[36m$wg_server\033[0m" \
separator_line "=" "3) 设置\033[36mEndpoint端口\033[0m \033[36m$wg_port\033[0m" \
content_line "1) \033[32m启用/关闭\033[0mWireguard服务 \033[32m$wg_service\033[0m" "4) 设置\033[36m公钥-PublicKey\033[0m \033[36m$wgp_key_info\033[0m" \
content_line "" "5) 设置\033[36m密钥-PresharedKey\033[0m \033[36m$wgpsk_key_info\033[0m" \
content_line "2) 设置\033[36mEndpoint地址\033[0m \033[36m$wg_server\033[0m" "" \
content_line "3) 设置\033[36mEndpoint端口\033[0m \033[36m$wg_port\033[0m" "6) 设置\033[33m私钥-PrivateKey\033[0m \033[33m$wgv_key_info\033[0m" \
content_line "4) 设置\033[36m公钥-PublicKey\033[0m \033[36m$wgp_key_info\033[0m" "7) 设置\033[33m组网IPV4地址\033[0m \033[33m$wg_ipv4\033[0m" \
content_line "5) 设置\033[36m密钥-PresharedKey\033[0m \033[36m$wgpsk_key_info\033[0m" "8) 可选\033[33m组网IPV6地址\033[0m \033[33m$wg_ipv6\033[0m" \
content_line "" "" \
content_line "6) 设置\033[33m私钥-PrivateKey\033[0m \033[33m$wgv_key_info\033[0m" "0) 返回上级菜单"
content_line "7) 设置\033[33m组网IPV4地址\033[0m \033[33m$wg_ipv4\033[0m"
content_line "8) 可选\033[33m组网IPV6地址\033[0m \033[33m$wg_ipv6\033[0m"
content_line ""
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -736,11 +632,7 @@ set_wireguard() {
[ "$wg_service" = ON ] && wg_service=OFF || wg_service=ON [ "$wg_service" = ON ] && wg_service=OFF || wg_service=ON
setconfig wg_service "$wg_service" setconfig wg_service "$wg_service"
else else
line_break msg_alert "\033[31m请先完成必选设置\033[0m"
separator_line "="
content_line "\033[31m请先完成必选设置\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
[1-8]) [1-8])
@@ -780,7 +672,6 @@ set_wireguard() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done

View File

@@ -16,17 +16,13 @@ ssh_tools() {
while true; do while true; do
[ -n "$(cat /etc/firewall.user 2>&1 | grep '启用外网访问SSH服务')" ] && ssh_ol=禁止 || ssh_ol=开启 [ -n "$(cat /etc/firewall.user 2>&1 | grep '启用外网访问SSH服务')" ] && ssh_ol=禁止 || ssh_ol=开启
[ -z "$ssh_port" ] && ssh_port=10022 [ -z "$ssh_port" ] && ssh_port=10022
line_break comp_box "\033[33m此功能仅针对使用Openwrt系统的设备生效且不依赖服务\033[0m" \
separator_line "=" "\033[31m本功能不支持红米AX6S等镜像化系统设备请勿尝试\033[0m"
content_line "\033[33m此功能仅针对使用Openwrt系统的设备生效且不依赖服务\033[0m" btm_box "1) \033[32m修改\033[0m外网访问端口\033[36m$ssh_port\033[0m" \
content_line "\033[31m本功能不支持红米AX6S等镜像化系统设备请勿尝试\033[0m" "2) \033[32m修改\033[0mSSH访问密码(请连续输入2次后回车)" \
separator_line "=" "3) \033[33m$ssh_ol\033[0m外网访问SSH" \
content_line "1) \033[32m修改\033[0m外网访问端口\033[36m$ssh_port\033[0m" "" \
content_line "2) \033[32m修改\033[0mSSH访问密码(请连续输入2次后回车)" "0) 返回上级菜单 \033[0m"
content_line "3) \033[33m$ssh_ol\033[0m外网访问SSH"
content_line ""
content_line "0) 返回上级菜单 \033[0m"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -38,56 +34,38 @@ ssh_tools() {
if [ -z "$num" ]; then if [ -z "$num" ]; then
errornum errornum
elif [ "$num" -gt 65535 ] || [ "$num" -le 999 ]; then elif [ "$num" -gt 65535 ] || [ "$num" -le 999 ]; then
line_break msg_alert "\033[31m输入错误请输入正确的数值(1000-65535)\033[0m"
separator_line "="
content_line "\033[31m输入错误请输入正确的数值(1000-65535)\033[0m"
separator_line "="
elif [ -n "$(netstat -ntul | grep :$num)" ]; then elif [ -n "$(netstat -ntul | grep :$num)" ]; then
line_break msg_alert "\033[31m当前端口已被其他进程占用请重新输入\033[0m"
separator_line "="
content_line "\033[31m当前端口已被其他进程占用请重新输入\033[0m"
separator_line "="
else else
ssh_port=$num ssh_port=$num
setconfig ssh_port "$ssh_port" setconfig ssh_port "$ssh_port"
sed -i "/启用外网访问SSH服务/d" /etc/firewall.user sed -i "/启用外网访问SSH服务/d" /etc/firewall.user
stop_iptables stop_iptables
line_break msg_alert "\033[32m设置成功请重新开启外网访问SSH功能"
separator_line "="
content_line "\033[32m设置成功请重新开启外网访问SSH功能"
separator_line "="
fi fi
sleep 1
;; ;;
2) 2)
passwd passwd
sleep 1 sleep 1
;; ;;
3) 3)
line_break
if [ "$ssh_ol" = "开启" ]; then if [ "$ssh_ol" = "开启" ]; then
iptables -w -t nat -A PREROUTING -p tcp -m multiport --dports "$ssh_port" -j REDIRECT --to-ports 22 iptables -w -t nat -A PREROUTING -p tcp -m multiport --dports "$ssh_port" -j REDIRECT --to-ports 22
[ -n "$(ckcmd ip6tables)" ] && ip6tables -w -t nat -A PREROUTING -p tcp -m multiport --dports "$ssh_port" -j REDIRECT --to-ports 22 [ -n "$(ckcmd ip6tables)" ] && ip6tables -w -t nat -A PREROUTING -p tcp -m multiport --dports "$ssh_port" -j REDIRECT --to-ports 22
echo "iptables -w -t nat -A PREROUTING -p tcp -m multiport --dports $ssh_port -j REDIRECT --to-ports 22 #启用外网访问SSH服务" >>/etc/firewall.user echo "iptables -w -t nat -A PREROUTING -p tcp -m multiport --dports $ssh_port -j REDIRECT --to-ports 22 #启用外网访问SSH服务" >>/etc/firewall.user
[ -n "$(ckcmd ip6tables)" ] && echo "ip6tables -w -t nat -A PREROUTING -p tcp -m multiport --dports $ssh_port -j REDIRECT --to-ports 22 #启用外网访问SSH服务" >>/etc/firewall.user [ -n "$(ckcmd ip6tables)" ] && echo "ip6tables -w -t nat -A PREROUTING -p tcp -m multiport --dports $ssh_port -j REDIRECT --to-ports 22 #启用外网访问SSH服务" >>/etc/firewall.user
separator_line "=" comp_box "已开启外网访问SSH功能"
content_line "已开启外网访问SSH功能"
separator_line "="
else else
sed -i "/启用外网访问SSH服务/d" /etc/firewall.user sed -i "/启用外网访问SSH服务/d" /etc/firewall.user
stop_iptables stop_iptables
comp_box "已禁止外网访问SSH"
separator_line "="
content_line "已禁止外网访问SSH"
separator_line "="
fi fi
break break
;; ;;
*) *)
errornum errornum
sleep 1
break
;; ;;
esac esac
done done
@@ -100,15 +78,11 @@ tools() {
grep -qE "^\s*[^#].*otapredownload" /etc/crontabs/root >/dev/null 2>&1 && mi_update=禁用 || mi_update=启用 grep -qE "^\s*[^#].*otapredownload" /etc/crontabs/root >/dev/null 2>&1 && mi_update=禁用 || mi_update=启用
[ "$mi_mi_autoSSH" = "已配置" ] && mi_mi_autoSSH_type=32m已配置 || mi_mi_autoSSH_type=31m未配置 [ "$mi_mi_autoSSH" = "已配置" ] && mi_mi_autoSSH_type=32m已配置 || mi_mi_autoSSH_type=31m未配置
[ -f "$CRASHDIR"/tools/tun.ko ] && mi_tunfix=32mON || mi_tunfix=31mOFF [ -f "$CRASHDIR"/tools/tun.ko ] && mi_tunfix=32mON || mi_tunfix=31mOFF
comp_box "\033[30;47m工具与优化\033[0m" \
line_break "" \
separator_line "=" "\033[33m本页工具可能无法兼容全部Linux设备请酌情使用\033[0m" \
content_line "\033[30;47m工具与优化\033[0m" "磁盘占用/所在目录:" \
separator_line "=" "$(du -sh "$CRASHDIR")"
content_line "\033[33m本页工具可能无法兼容全部Linux设备请酌情使用\033[0m"
content_line "磁盘占用/所在目录:"
content_line "$(du -sh "$CRASHDIR")"
separator_line "="
content_line "1) ShellCrash\033[33m测试菜单\033[0m" content_line "1) ShellCrash\033[33m测试菜单\033[0m"
content_line "2) ShellCrash\033[32m新手引导\033[0m" content_line "2) ShellCrash\033[32m新手引导\033[0m"
content_line "3) \033[36m日志及推送工具\033[0m" content_line "3) \033[36m日志及推送工具\033[0m"
@@ -116,9 +90,8 @@ tools() {
[ -x /usr/sbin/otapredownload ] && content_line "5) \033[33m$mi_update\033[0m小米系统自动更新" [ -x /usr/sbin/otapredownload ] && content_line "5) \033[33m$mi_update\033[0m小米系统自动更新"
[ "$systype" = "mi_snapshot" ] && content_line "6) 小米设备软固化SSH ———— \033[$mi_mi_autoSSH_type \033[0m" [ "$systype" = "mi_snapshot" ] && content_line "6) 小米设备软固化SSH ———— \033[$mi_mi_autoSSH_type \033[0m"
[ "$systype" = "mi_snapshot" ] && content_line "8) 小米设备Tun模块修复 ———— \033[$mi_tunfix \033[0m" [ "$systype" = "mi_snapshot" ] && content_line "8) 小米设备Tun模块修复 ———— \033[$mi_tunfix \033[0m"
content_line "" btm_box "" \
content_line "0) 返回上级菜单" "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -149,21 +122,14 @@ tools() {
sed -i "/^\s*#.*otapredownload/ s/^\s*#//" /etc/crontabs/root || sed -i "/^\s*#.*otapredownload/ s/^\s*#//" /etc/crontabs/root ||
echo "15 3,4,5 * * * /usr/sbin/otapredownload >/dev/null 2>&1" >>/etc/crontabs/root echo "15 3,4,5 * * * /usr/sbin/otapredownload >/dev/null 2>&1" >>/etc/crontabs/root
fi fi
line_break msg_alert "已\033[33m$mi_update\033[0m小米路由器的自动更新如未生效请在官方APP中同步设置"
separator_line "="
content_line "已\033[33m$mi_update\033[0m小米路由器的自动更新如未生效请在官方APP中同步设置"
separator_line "="
sleep 1
fi fi
;; ;;
6) 6)
if [ "$systype" = "mi_snapshot" ]; then if [ "$systype" = "mi_snapshot" ]; then
mi_autoSSH mi_autoSSH
else else
line_break msg_alert "不支持的设备!"
separator_line "="
content_line "不支持的设备!"
separator_line "="
fi fi
;; ;;
7) 7)
@@ -185,33 +151,24 @@ tools() {
sleep 1 sleep 1
;; ;;
8) 8)
line_break
separator_line "="
if [ -f "$CRASHDIR"/tools/tun.ko ]; then if [ -f "$CRASHDIR"/tools/tun.ko ]; then
content_line "是否禁用此功能并移除相关补丁" comp_box "是否禁用此功能并移除相关补丁"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
rm -rf "$CRASHDIR"/tools/tun.ko rm -rf "$CRASHDIR"/tools/tun.ko
line_break msg_alert "\033[33m补丁文件已移除请立即重启设备以防止出错\033[0m"
separator_line "="
content_line "\033[33m补丁文件已移除请立即重启设备以防止出错\033[0m"
separator_line "="
} }
elif ckcmd modinfo && [ -z "$(modinfo tun)" ]; then elif ckcmd modinfo && [ -z "$(modinfo tun)" ]; then
content_line "\033[33m本功能需要修改系统文件不保证没有任何风险\033[0m" comp_box "\033[33m本功能需要修改系统文件不保证没有任何风险\033[0m" \
content_line "\033[33m本功能采集的Tun模块并不一定适用于你的设备\033[0m" "\033[33m本功能采集的Tun模块并不一定适用于你的设备\033[0m"
separator_line "=" btm_box "1) 我已知晓,出现问题会自行承担!" \
content_line "1) 我已知晓,出现问题会自行承担!" "0) 返回上级菜单"
content_line "0) 返回上级菜单"
eparator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
line_break line_break
eparator_line "=" separator_line "="
content_line "正在连接服务器获取Tun模块补丁文件......" content_line "正在连接服务器获取Tun模块补丁文件......"
get_bin "$TMPDIR"/tun.ko bin/fix/tun.ko get_bin "$TMPDIR"/tun.ko bin/fix/tun.ko
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
@@ -221,33 +178,26 @@ tools() {
else else
content_line "\033[31m文件下载失败请重试\033[0m" content_line "\033[31m文件下载失败请重试\033[0m"
fi fi
eparator_line "=" separator_line "="
else else
continue continue
fi fi
else else
content_line "\033[31m当前设备无需设置请勿尝试\033[0m" msg_alert "\033[31m当前设备无需设置请勿尝试\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
} }
mi_autoSSH() { mi_autoSSH() {
line_break comp_box "\033[33m本功能使用软件命令进行固化不保证100%成功!\033[0m" \
separator_line "=" "\033[33m如有问题请加群反馈\033[36;4mhttps://t.me/ShellClash\033[0m"
content_line "\033[33m本功能使用软件命令进行固化不保证100%成功!\033[0m" btm_box "请输入需要还原的SSH密码不影响当前密码" \
content_line "\033[33m如有问题请加群反馈\033[36;4mhttps://t.me/ShellClash\033[0m" "(回车可跳过)"
content_line ""
content_line "请输入需要还原的SSH密码不影响当前密码"
content_line "(回车可跳过)"
separator_line "="
read -r -p "请输入> " mi_mi_autoSSH_pwd read -r -p "请输入> " mi_mi_autoSSH_pwd
mi_mi_autoSSH=已配置 mi_mi_autoSSH=已配置
cp -f /etc/dropbear/dropbear_rsa_host_key "$CRASHDIR"/configs/dropbear_rsa_host_key 2>/dev/null cp -f /etc/dropbear/dropbear_rsa_host_key "$CRASHDIR"/configs/dropbear_rsa_host_key 2>/dev/null
@@ -259,13 +209,9 @@ mi_autoSSH() {
nvram set boot_wait=on nvram set boot_wait=on
nvram commit nvram commit
} }
line_break
separator_line "="
content_line "\033[32m设置成功\033[0m"
separator_line "="
setconfig mi_mi_autoSSH $mi_mi_autoSSH setconfig mi_mi_autoSSH $mi_mi_autoSSH
setconfig mi_mi_autoSSH_pwd "$mi_mi_autoSSH_pwd" setconfig mi_mi_autoSSH_pwd "$mi_mi_autoSSH_pwd"
sleep 1 msg_alert "\033[32m设置成功\033[0m"
} }
# 日志菜单 # 日志菜单
@@ -280,37 +226,30 @@ log_pusher() {
[ -n "$push_Gotify" ] && stat_Gotify=32mON || stat_Gotify=33mOFF [ -n "$push_Gotify" ] && stat_Gotify=32mON || stat_Gotify=33mOFF
[ "$task_push" = 1 ] && stat_task=32mON || stat_task=33mOFF [ "$task_push" = 1 ] && stat_task=32mON || stat_task=33mOFF
[ -n "$device_name" ] && device_s=32m$device_name || device_s=33m未设置 [ -n "$device_name" ] && device_s=32m$device_name || device_s=33m未设置
line_break comp_box "1) Telegram推送 ——\033[$stat_TG\033[0m" \
separator_line "=" "2) PushDeer推送 ——\033[$stat_Deer\033[0m" \
content_line "1) Telegram推送 ——\033[$stat_TG\033[0m" "3) Bark推送-IOS ——\033[$stat_bark\033[0m" \
content_line "2) PushDeer推送 ——\033[$stat_Deer\033[0m" "4) Passover推送 ——\033[$stat_Po\033[0m" \
content_line "3) Bark推送-IOS ——\033[$stat_bark\033[0m" "5) PushPlus推送 ——\033[$stat_PP\033[0m" \
content_line "4) Passover推送 ——\033[$stat_Po\033[0m" "6) SynoChat推送 ——\033[$stat_SynoChat\033[0m" \
content_line "5) PushPlus推送 ——\033[$stat_PP\033[0m" "7) Gotify推送 ——\033[$stat_Gotify\033[0m" \
content_line "6) SynoChat推送 ——\033[$stat_SynoChat\033[0m" "" \
content_line "7) Gotify推送 ——\033[$stat_Gotify\033[0m" "a) 查看\033[36m运行日志\033[0m" \
content_line "" "b) 推送任务日志 ——\033[$stat_task\033[0m" \
content_line "a) 查看\033[36m运行日志\033[0m" "c) 设置设备名称 ——\033[$device_s\033[0m" \
content_line "b) 推送任务日志 ——\033[$stat_task\033[0m" "d) 清空日志文件" \
content_line "c) 设置设备名称 ——\033[$device_s\033[0m" "" \
content_line "d) 清空日志文件" "0) 返回上级菜单"
content_line ""
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
1) 1)
line_break
separator_line "="
if [ -n "$push_TG" ]; then if [ -n "$push_TG" ]; then
content_line "是否确认关闭TG日志推送" comp_box "是否确认关闭TG日志推送"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
push_TG= push_TG=
@@ -324,10 +263,10 @@ log_pusher() {
# echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m" # echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m"
. "$CRASHDIR"/menus/bot_tg_bind.sh . "$CRASHDIR"/menus/bot_tg_bind.sh
chose_bot() { chose_bot() {
content_line "1) 使用公共机器人 ——不依赖内核服务" comp_box "1) 使用公共机器人 ——不依赖内核服务" \
content_line "2) 使用私人机器人 ——需要额外申请" "2) 使用私人机器人 ——需要额外申请" \
content_line "0) 返回上级菜单" "" \
separator_line "=" "0) 返回上级菜单"
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
0) 0)
@@ -350,14 +289,10 @@ log_pusher() {
fi fi
;; ;;
2) 2)
line_break
separator_line "="
if [ -n "$push_Deer" ]; then if [ -n "$push_Deer" ]; then
content_line "是否确认关闭PushDeer日志推送" comp_box "是否确认关闭PushDeer日志推送"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
push_Deer= push_Deer=
@@ -367,14 +302,12 @@ log_pusher() {
fi fi
else else
# echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m" # echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m"
content_line "1. 请先前往 \033[32;4mhttp://www.pushdeer.com/official.html\033[0m 扫码安装快应用或下载APP" comp_box "1. 请先前往 \033[32;4mhttp://www.pushdeer.com/official.html\033[0m 扫码安装快应用或下载APP" \
content_line "2. 打开快应用/APP并完成登陆" "2. 打开快应用/APP并完成登陆" \
content_line "3. \033[33m切换到「设备」标签页点击右上角的加号注册当前设备\033[0m" "3. \033[33m切换到「设备」标签页点击右上角的加号注册当前设备\033[0m" \
content_line "4. \033[36m切换到「秘钥」标签页点击右上角的加号创建一个秘钥并复制\033[0m" "4. \033[36m切换到「秘钥」标签页点击右上角的加号创建一个秘钥并复制\033[0m"
separator_line "=" btm_box "\033[36m请直接输入你复制的秘钥\033[0m" \
content_line "请直接输入你复制的秘钥" "或输入 0 返回上级菜单"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " url read -r -p "请输入> " url
if [ "$url" = 0 ]; then if [ "$url" = 0 ]; then
continue continue
@@ -383,25 +316,16 @@ log_pusher() {
setconfig push_Deer "$url" setconfig push_Deer "$url"
logger "已完成PushDeer日志推送设置" 32 logger "已完成PushDeer日志推送设置" 32
else else
line_break msg_alert "\033[31m输入错误请重新输入\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新输入\033[0m"
separator_line "="
fi fi
sleep 1
fi fi
;; ;;
3) 3)
line_break
separator_line "="
if [ -n "$push_bark" ]; then if [ -n "$push_bark" ]; then
content_line "是否确认关闭Bark日志推送" comp_box "是否确认关闭Bark日志推送"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
push_bark= push_bark=
bark_param= bark_param=
@@ -412,12 +336,10 @@ log_pusher() {
fi fi
else else
# echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m" # echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m"
content_line "\033[33mBark推送仅支持IOS系统其他平台请使用其他推送方式\033[0m" comp_box "\033[33mBark推送仅支持IOS系统其他平台请使用其他推送方式\033[0m" \
content_line "\033[32m请安装Bark-IOS客户端并在客户端中找到专属推送链接\033[0m" "\033[32m请安装Bark-IOS客户端并在客户端中找到专属推送链接\033[0m"
separator_line "=" btm_box "\033[36m请直接输入你的Bark推送链接\033[0m" \
content_line "请直接输入你的Bark推送链接" "或输入 0 返回上级菜单"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " url read -r -p "请输入> " url
if [ "$url" = 0 ]; then if [ "$url" = 0 ]; then
continue continue
@@ -426,25 +348,16 @@ log_pusher() {
setconfig push_bark "$url" setconfig push_bark "$url"
logger "已完成Bark日志推送设置" 32 logger "已完成Bark日志推送设置" 32
else else
line_break msg_alert "\033[31m输入错误请重新输入\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新输入\033[0m"
separator_line "="
fi fi
sleep 1
fi fi
;; ;;
4) 4)
line_break
separator_line "="
if [ -n "$push_Po" ]; then if [ -n "$push_Po" ]; then
content_line "是否确认关闭Pushover日志推送" comp_box "是否确认关闭Pushover日志推送"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
push_Po= push_Po=
push_Po_key= push_Po_key=
@@ -455,25 +368,20 @@ log_pusher() {
fi fi
else else
# echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m" # echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m"
content_line "请先通过 \033[32;4mhttps://pushover.net/\033[0m 注册账号并获取\033[36mUser Key\033[0m" comp_box "请先通过 \033[32;4mhttps://pushover.net/\033[0m 注册账号并获取\033[36mUser Key\033[0m" \
content_line "" "" \
content_line "请直接请输入你的User Key" "\033[36m请直接请输入你的User Key\033[0m" \
content_line "或输入 0 返回上级菜单" "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " key read -r -p "请输入> " key
if [ "$key" = 0 ]; then if [ "$key" = 0 ]; then
continue continue
elif [ -n "$key" ]; then elif [ -n "$key" ]; then
line_break comp_box "\033[33m请检查注册邮箱完成账户验证\033[0m"
separator_line "=" btm_box "1) 我已经验证完成" \
content_line "\033[33m请检查注册邮箱完成账户验证\033[0m" "0) 返回上级菜单"
read -r -p "我已经验证完成(1/0)> " read -r -p "我已经验证完成(1/0)> " res
separator_line "=" if [ "$res" = 1 ]; then
comp_box "请通过 \033[32;4mhttps://pushover.net/apps/build\033[0m 生成\033[36mAPI Token\033[0m"
line_break
separator_line "="
content_line "请通过 \033[32;4mhttps://pushover.net/apps/build\033[0m 生成\033[36mAPI Token\033[0m"
separator_line "="
read -r -p "请输入你的API Token> " Token read -r -p "请输入你的API Token> " Token
if [ -n "$Token" ]; then if [ -n "$Token" ]; then
push_Po=$Token push_Po=$Token
@@ -482,29 +390,21 @@ log_pusher() {
setconfig push_Po_key "$key" setconfig push_Po_key "$key"
logger "已完成Passover日志推送设置" 32 logger "已完成Passover日志推送设置" 32
else else
line_break msg_alert "\033[31m输入错误请重新输入\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新输入\033[0m"
separator_line "="
fi fi
else else
line_break continue
separator_line "=" fi
content_line "\033[31m输入错误请重新输入\033[0m" else
separator_line "=" msg_alert "\033[31m输入错误请重新输入\033[0m"
fi fi
sleep 1
fi fi
;; ;;
5) 5)
line_break
separator_line "="
if [ -n "$push_PP" ]; then if [ -n "$push_PP" ]; then
content_line "是否确认关闭PushPlus日志推送" comp_box "是否确认关闭PushPlus日志推送"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
push_PP= push_PP=
@@ -514,11 +414,9 @@ log_pusher() {
fi fi
else else
# echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m" # echo -e "\033[33m详细设置指南请参考 https://juewuy.github.io/ \033[0m"
content_line "请先通过 \033[32;4mhttps://www.pushplus.plus/push1.html\033[0m 注册账号并获取\033[36mtoken\033[0m" comp_box "请先通过 \033[32;4mhttps://www.pushplus.plus/push1.html\033[0m 注册账号并获取\033[36mtoken\033[0m"
separator_line "=" btm_box "\033[36m请直接输入你的token\033[0m" \
content_line "请直接输入你的token" "或输入 0 返回上级菜单"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " Token read -r -p "请输入> " Token
if [ "$Token" = 0 ]; then if [ "$Token" = 0 ]; then
continue continue
@@ -527,23 +425,15 @@ log_pusher() {
setconfig push_PP "$Token" setconfig push_PP "$Token"
logger "已完成PushPlus日志推送设置" 32 logger "已完成PushPlus日志推送设置" 32
else else
line_break msg_alert "\033[31m输入错误请重新输入\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新输入\033[0m"
separator_line "="
fi fi
sleep 1
fi fi
;; ;;
6) 6)
line_break
if [ -n "$push_SynoChat" ]; then if [ -n "$push_SynoChat" ]; then
separator_line "=" comp_box "是否确认关闭SynoChat日志推送"
content_line "是否确认关闭SynoChat日志推送" btm_box "1) 是" \
separator_line "=" "0) 否,返回上级菜单"
content_line "1) 是"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
push_SynoChat= push_SynoChat=
@@ -552,15 +442,10 @@ log_pusher() {
continue continue
fi fi
else else
line_break
read -r -p "请输入你的Synology DSM主页地址> " URL read -r -p "请输入你的Synology DSM主页地址> " URL
line_break
read -r -p "请输入你的Synology Chat Token> " TOKEN read -r -p "请输入你的Synology Chat Token> " TOKEN
comp_box '请通过"你的群晖地址/webapi/entry.cgi?api=SYNO.Chat.External&method=user_list&version=2&token=你的TOKEN"获取user_id'
line_break
separator_line "="
content_line '请通过"你的群晖地址/webapi/entry.cgi?api=SYNO.Chat.External&method=user_list&version=2&token=你的TOKEN"获取user_id'
separator_line "="
read -r -p "请输入你的user_id> " USERID read -r -p "请输入你的user_id> " USERID
if [ -n "$URL" ]; then if [ -n "$URL" ]; then
push_SynoChat=$USERID push_SynoChat=$USERID
@@ -576,24 +461,16 @@ log_pusher() {
push_SynoChat= push_SynoChat=
setconfig push_SynoChat setconfig push_SynoChat
line_break msg_alert "\033[31m输入错误请重新输入\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新输入\033[0m"
separator_line "="
fi fi
sleep 1
fi fi
;; ;;
# 在menu.sh的case $num in代码块中添加 # 在menu.sh的case $num in代码块中添加
7) 7)
line_break
separator_line "="
if [ -n "$push_Gotify" ]; then if [ -n "$push_Gotify" ]; then
content_line "是否确认关闭Gotify日志推送" comp_box "是否确认关闭Gotify日志推送"
separator_line "=" btm_box "1) 是" \
content_line "1) " "0) 否,返回上级菜单"
content_line "0) 否,返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
push_Gotify= push_Gotify=
@@ -602,12 +479,10 @@ log_pusher() {
continue continue
fi fi
else else
content_line "请先通过Gotify服务器获取推送URL" comp_box "请先通过Gotify服务器获取推送URL" \
content_line "格式示例: https://gotify.example.com/message?token=你的应用令牌" "格式示例: https://gotify.example.com/message?token=你的应用令牌"
content_line "" btm_box "\033[36m请直接你的Gotify推送URL\033[0m" \
content_line "请直接你的Gotify推送URL" "或输入 0 返回上级菜单"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " url read -r -p "请输入> " url
if [ "$url" = 0 ]; then if [ "$url" = 0 ]; then
continue continue
@@ -616,24 +491,20 @@ log_pusher() {
setconfig push_Gotify "$url" setconfig push_Gotify "$url"
logger "已完成Gotify日志推送设置" 32 logger "已完成Gotify日志推送设置" 32
else else
line_break msg_alert "\033[31m输入错误请重新输入\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新输入\033[0m"
separator_line "="
fi fi
sleep 1
fi fi
;; ;;
a) a)
line_break
if [ -s "$TMPDIR"/ShellCrash.log ]; then if [ -s "$TMPDIR"/ShellCrash.log ]; then
line_break
echo "==========================================================="
cat "$TMPDIR"/ShellCrash.log cat "$TMPDIR"/ShellCrash.log
echo "==========================================================="
exit
else else
separator_line "=" msg_alert "\033[31m未找到相关日志\033[0m"
content_line "\033[31m未找到相关日志\033[0m"
separator_line "="
fi fi
sleep 1
;; ;;
b) b)
[ "$task_push" = 1 ] && task_push='' || task_push=1 [ "$task_push" = 1 ] && task_push='' || task_push=1
@@ -641,11 +512,8 @@ log_pusher() {
sleep 1 sleep 1
;; ;;
c) c)
line_break comp_box "请直接输入本设备自定义推送名称" \
separator_line "=" "或直接回车确认返回上级菜单"
content_line "请直接输入本设备自定义推送名称"
content_line "或直接回车确认返回上级菜单"
separator_line "="
read -r -p "请输入> " device_name read -r -p "请输入> " device_name
if [ -n "$device_name" ]; then if [ -n "$device_name" ]; then
setconfig device_name "$device_name" setconfig device_name "$device_name"
@@ -653,15 +521,10 @@ log_pusher() {
;; ;;
d) d)
rm -rf "$TMPDIR"/ShellCrash.log rm -rf "$TMPDIR"/ShellCrash.log
line_break msg_alert "\033[33m运行日志及任务日志均已清空\033[0m"
separator_line "="
content_line "\033[33m运行日志及任务日志均已清空\033[0m"
separator_line "="
sleep 1
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -670,20 +533,16 @@ log_pusher() {
# 测试菜单 # 测试菜单
testcommand() { testcommand() {
while true; do while true; do
line_break comp_box "\033[30;47m这里是测试命令菜单\033[0m" \
separator_line "=" "\033[33m如遇问题尽量运行相应命令后截图提交issue或TG讨论组\033[0m"
content_line "\033[30;47m这里是测试命令菜单\033[0m" btm_box "1) Debug模式运行内核" \
content_line "\033[33m如遇问题尽量运行相应命令后截图提交issue或TG讨论组\033[0m" "2) 查看系统DNS端口(:53)占用 " \
separator_line "=" "3) 测试ssl加密(aes-128-gcm)跑分" \
content_line "1) Debug模式运行内核" "4) 查看ShellCrash相关路由规则" \
content_line "2) 查看系统DNS端口(:53)占用 " "5) 查看内核配置文件前40行" \
content_line "3) 测试ssl加密(aes-128-gcm)跑分" "6) 测试代理服务器连通性(google.tw)" \
content_line "4) 查看ShellCrash相关路由规则" "" \
content_line "5) 查看内核配置文件前40行" "0) 返回上级目录"
content_line "6) 测试代理服务器连通性(google.tw)"
content_line ""
content_line "0) 返回上级目录"
separator_line "="
read -r -p "请输入对应数字> " num read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
0) 0)
@@ -691,20 +550,18 @@ testcommand() {
;; ;;
1) 1)
debug debug
testcommand
;; ;;
2) 2)
line_break line_break
echo "==========================================================="
netstat -ntulp | grep 53 netstat -ntulp | grep 53
separator_line "=" echo
content_line "可以使用\033[44m netstat -ntulp |grep xxx \033[0m来查询任意(xxx)端口" echo -e "可以使用\033[44m netstat -ntulp |grep xxx \033[0m来查询任意(xxx)端口"
separator_line "=" echo "==========================================================="
line_break
;; ;;
3) 3)
line_break line_break
openssl speed -multi 4 -evp aes-128-gcm openssl speed -multi 4 -evp aes-128-gcm
line_break
;; ;;
4) 4)
line_break line_break
@@ -756,19 +613,14 @@ testcommand() {
echo "----------------本机防火墙---------------------" echo "----------------本机防火墙---------------------"
iptables -L INPUT --line-numbers iptables -L INPUT --line-numbers
fi fi
line_break
;; ;;
5) 5)
echo "$crashcore" | grep -q 'singbox' && config_path="$CRASHDIR"/jsons/config.json || config_path="$CRASHDIR"/yamls/config.yaml echo "$crashcore" | grep -q 'singbox' && config_path="$CRASHDIR"/jsons/config.json || config_path="$CRASHDIR"/yamls/config.yaml
line_break line_break
sed -n '1,40p' "$config_path" sed -n '1,40p' "$config_path"
line_break
;; ;;
6) 6)
line_break comp_box "\033[33m注意依赖curl不支持wget且测试结果不保证一定准确\033[0m"
separator_line "="
content_line "\033[33m注意依赖curl不支持wget且测试结果不保证一定准确\033[0m"
separator_line "="
delay=$( delay=$(
curl -kx ${authentication}@127.0.0.1:$mix_port -o /dev/null -s -w '%{time_starttransfer}' 'https://google.tw' & curl -kx ${authentication}@127.0.0.1:$mix_port -o /dev/null -s -w '%{time_starttransfer}' 'https://google.tw' &
{ {
@@ -795,25 +647,21 @@ testcommand() {
debug() { debug() {
echo "$crashcore" | grep -q 'singbox' && config_tmp="$TMPDIR"/jsons || config_tmp="$TMPDIR"/config.yaml echo "$crashcore" | grep -q 'singbox' && config_tmp="$TMPDIR"/jsons || config_tmp="$TMPDIR"/config.yaml
line_break comp_box "\033[36m注意Debug运行均会停止原本的内核服务\033[0m" \
separator_line "=" "后台运行日志地址:\033[32m$TMPDIR/debug.log\033[0m" \
content_line "\033[36m注意Debug运行均会停止原本的内核服务\033[0m" "如长时间运行后台监测日志等级推荐error防止文件过大" \
content_line "后台运行日志地址:\033[32m$TMPDIR/debug.log\033[0m" "你亦可通过:\033[33mcrash -s debug 'warning'\033[0m命令使用其他日志等级"
content_line "如长时间运行后台监测日志等级推荐error防止文件过大"
content_line "你亦可通过:\033[33mcrash -s debug 'warning'\033[0m命令使用其他日志等级"
separator_line "="
content_line "1) 仅测试\033[32m$config_tmp\033[0m配置文件可用性" content_line "1) 仅测试\033[32m$config_tmp\033[0m配置文件可用性"
content_line "2) 前台运行\033[32m$config_tmp\033[0m配置文件,不配置防火墙劫持(\033[33m使用Ctrl+C手动停止\033[0m)" content_line "2) 前台运行\033[32m$config_tmp\033[0m配置文件不配置防火墙劫持(\033[33m使用Ctrl+C手动停止\033[0m)"
content_line "3) 后台运行完整启动流程,并配置防火墙劫持,日志等级:\033[31merror\033[0m" content_line "3) 后台运行完整启动流程并配置防火墙劫持日志等级\033[31merror\033[0m"
content_line "4) 后台运行完整启动流程,并配置防火墙劫持,日志等级:\033[32minfo\033[0m" content_line "4) 后台运行完整启动流程并配置防火墙劫持日志等级\033[32minfo\033[0m"
content_line "5) 后台运行完整启动流程,并配置防火墙劫持,日志等级:\033[33mdebug\033[0m" content_line "5) 后台运行完整启动流程并配置防火墙劫持日志等级\033[33mdebug\033[0m"
content_line "6) 后台运行完整启动流程,并配置防火墙劫持,且将错误日志打印到闪存:\033[32m$CRASHDIR/debug.log\033[0m" content_line "6) 后台运行完整启动流程并配置防火墙劫持且将错误日志打印到闪存:\033[32m$CRASHDIR/debug.log\033[0m"
content_line "" content_line ""
content_line "8) 后台运行完整启动流程,输出执行错误并查找上下文,之后关闭进程" content_line "8) 后台运行完整启动流程,输出执行错误并查找上下文之后关闭进程"
[ -s "$TMPDIR"/jsons/inbounds.json ] && content_line " 9) 将\033[32m$config_tmp\033[0m下json文件合并为$TMPDIR/debug.json" [ -s "$TMPDIR"/jsons/inbounds.json ] && content_line "9) 将\033[32m$config_tmp\033[0m下json文件合并为$TMPDIR/debug.json"
content_line "" btm_box "" \
content_line "0) 返回上级目录" "0) 返回上级目录"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
0) ;; 0) ;;
@@ -855,15 +703,10 @@ debug() {
main_menu main_menu
;; ;;
6) 6)
line_break comp_box "频繁写入闪存会导致闪存寿命降低如非遇到会导致设备死机或重启的bug请勿使用此功能" \
separator_line "=" "是否确认启用此功能?"
content_line "频繁写入闪存会导致闪存寿命降低如非遇到会导致设备死机或重启的bug请勿使用此功能" btm_box "1) 是" \
separator_line "=" "0) 否"
content_line "是否继续:"
separator_line "-"
content_line "1) 是"
content_line "0) 否"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
"$CRASHDIR"/start.sh debug debug flash "$CRASHDIR"/start.sh debug debug flash
@@ -876,9 +719,7 @@ debug() {
;; ;;
9) 9)
. "$CRASHDIR"/libs/core_webget.sh && core_find && "$TMPDIR"/CrashCore merge "$TMPDIR"/debug.json -C "$TMPDIR"/jsons && line_break . "$CRASHDIR"/libs/core_webget.sh && core_find && "$TMPDIR"/CrashCore merge "$TMPDIR"/debug.json -C "$TMPDIR"/jsons && line_break
separator_line "=" comp_box "\033[32m合并成功\033[0m"
content_line"\033[32m合并成功\033[0m"
separator_line "="
[ "$TMPDIR" = "$BINDIR" ] && rm -rf "$TMPDIR"/CrashCore [ "$TMPDIR" = "$BINDIR" ] && rm -rf "$TMPDIR"/CrashCore
main_menu main_menu
;; ;;

View File

@@ -9,47 +9,37 @@ __IS_MODULE_9_UPGRADE_LOADED=1
. "$CRASHDIR"/libs/web_get_bin.sh . "$CRASHDIR"/libs/web_get_bin.sh
error_down() { error_down() {
content_line "\033[33m请尝试切换至其他安装源后重新下载\033[0m" btm_box "\033[33m请尝试切换至其他安装源后重新下载\033[0m" \
content_line "或者参考 \033[32;4mhttps://juewuy.github.io/bdaz\033[0m 进行本地安装!" "或者参考 \033[32;4mhttps://juewuy.github.io/bdaz\033[0m 进行本地安装!"
separator_line "="
sleep 1 sleep 1
} }
# 更新/卸载功能菜单 # 更新/卸载功能菜单
upgrade() { upgrade() {
while true; do while true; do
if [ -z "$version_new" ]; then if [ -z "$version_new" ]; then
checkupdate checkupdate
line_break
else
line_break
fi fi
[ -z "$core_v" ] && core_v=$crashcore [ -z "$core_v" ] && core_v=$crashcore
core_v_new=$(eval echo \$"$crashcore"_v) core_v_new=$(eval echo \$"$crashcore"_v)
top_box "\033[30;47m更新与支持\033[0m" \
separator_line "=" "" \
content_line "\033[30;47m更新与支持\033[0m" "当前目录(\033[32m$CRASHDIR\033[0m)剩余空间:\033[36m$(dir_avail "$CRASHDIR" -h)\033[0m"
separator_line "="
content_line "当前目录(\033[32m$CRASHDIR\033[0m)剩余空间:\033[36m$(dir_avail "$CRASHDIR" -h)\033[0m"
[ "$(dir_avail "$CRASHDIR")" -le 5120 ] && [ "$CRASHDIR" = "$BINDIR" ] && { [ "$(dir_avail "$CRASHDIR")" -le 5120 ] && [ "$CRASHDIR" = "$BINDIR" ] && {
content_line "\033[33m当前目录剩余空间较低建议开启小闪存模式\033[0m" content_line "\033[33m当前目录剩余空间较低建议开启小闪存模式\033[0m"
} }
separator_line "=" separator_line "="
content_line "1) 更新\033[36m管理脚本\t\033[33m$versionsh_l\033[0m > \033[32m$version_new \033[36m$release_type\033[0m" btm_box "1) 更新\033[36m管理脚本\t\033[33m$versionsh_l\033[0m > \033[32m$version_new \033[36m$release_type\033[0m" \
content_line "2) 切换/更新\033[33m内核文件\t\033[33m$core_v\033[0m > \033[32m$core_v_new\033[0m" "2) 切换/更新\033[33m内核文件\t\033[33m$core_v\033[0m > \033[32m$core_v_new\033[0m" \
content_line "3) 安装/更新本地\033[32m数据库文件\033[0m" "3) 安装/更新本地\033[32m数据库文件\033[0m" \
content_line "4) 安装/更新本地\033[35mDashboard面板\033[0m" "4) 安装/更新本地\033[35mDashboard面板\033[0m" \
content_line "5) 安装/更新本地\033[33m根证书文件\033[0m" "5) 安装/更新本地\033[33m根证书文件\033[0m" \
content_line "6) \033[32mPAC\033[0m自动代理查看" "6) \033[32mPAC\033[0m自动代理查看" \
content_line "7) 切换\033[36m安装源及版本分支\033[0m" "7) 切换\033[36m安装源及版本分支\033[0m" \
content_line "8) \033[31m卸载ShellCrash\033[0m" "8) \033[31m卸载ShellCrash\033[0m" \
content_line "9) \033[36m感谢列表\033[0m" "9) \033[36m感谢列表\033[0m" \
content_line "" "" \
content_line "0) 返回上级菜单" "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应数字> " num read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -71,12 +61,8 @@ upgrade() {
setcrt setcrt
;; ;;
6) 6)
line_break msg_alert -t 2 "PAC配置链接为\033[30;47m http://$host:$db_port/ui/pac \033[0m" \
separator_line "=" "PAC的使用教程请参考\033[4;32mhttps://juewuy.github.io/ehRUeewcv\033[0m"
content_line "PAC配置链接为\033[30;47m http://$host:$db_port/ui/pac \033[0m"
content_line "PAC的使用教程请参考\033[4;32mhttps://juewuy.github.io/ehRUeewcv\033[0m"
separator_line "="
sleep 2
;; ;;
7) 7)
setserver setserver
@@ -85,50 +71,35 @@ upgrade() {
. "$CRASHDIR"/menus/uninstall.sh && uninstall . "$CRASHDIR"/menus/uninstall.sh && uninstall
;; ;;
9) 9)
line_break comp_box "感谢以下项目及其开发者们的无私奉献!"
separator_line "=" btm_box "\033[32mClash \033[0m开发\033[36mDreamacro\033[0m" \
content_line "感谢以下项目及其开发者们的无私奉献!" "" \
separator_line "=" "\033[32msing-box \033[0m开发\033[36mSagerNet\033[0m" \
"项目地址:\033[32mhttps://github.com/SagerNet/sing-box\033[0m" \
content_line "\033[32mClash \033[0m开发\033[36mDreamacro\033[0m" "" \
content_line "" "\033[32mMetaCubeX \033[0m开发\033[36mMetaCubeX\033[0m" \
"项目地址:\033[32mhttps://github.com/MetaCubeX\033[0m" \
content_line "\033[32msing-box \033[0m开发\033[36mSagerNet\033[0m" "" \
content_line "项目地址\033[32mhttps://github.com/SagerNet/sing-box\033[0m" "\033[32mYACD面板 \033[0m开发\033[36mhaishanh\033[0m" \
content_line "" "项目地址:\033[32mhttps://github.com/haishanh/yacd\033[0m" \
"" \
content_line "\033[32mMetaCubeX \033[0m开发\033[36mMetaCubeX\033[0m" "\033[32mZashboard \033[0m开发\033[36mZephyruso\033[0m" \
content_line "项目地址:\033[32mhttps://github.com/MetaCubeX\033[0m" "项目地址:\033[32mhttps://github.com/Zephyruso/zashboard\033[0m" \
content_line "" "" \
"\033[32mSubconverter \033[0m开发\033[36mtindy2013\033[0m" \
content_line "\033[32mYACD面板 \033[0m开发\033[36mhaishanh\033[0m" "项目地址\033[32mhttps://github.com/tindy2013/subconverter\033[0m" \
content_line "项目地址:\033[32mhttps://github.com/haishanh/yacd\033[0m" "" \
content_line "" "\033[32msing-box-reF1nd \033[0m开发\033[36mreF1nd\033[0m" \
"项目地址:\033[32mhttps://github.com/reF1nd/sing-box\033[0m" \
content_line "\033[32mZashboard \033[0m开发\033[36mZephyruso\033[0m" "" \
content_line "项目地址:\033[32mhttps://github.com/Zephyruso/zashboard\033[0m" "\033[32mDustinWin \033[0m开发\033[36mDustinWin\033[0m" \
content_line "" "开发者地址:\033[32mhttps://github.com/DustinWin\033[0m" \
""
content_line "\033[32mSubconverter \033[0m开发\033[36mtindy2013\033[0m" btm_box "特别感谢:\033[36m所有帮助及赞助过此项目的同仁们\033[0m"
content_line "项目地址:\033[32mhttps://github.com/tindy2013/subconverter\033[0m"
content_line ""
content_line "\033[32msing-box-reF1nd \033[0m开发\033[36mreF1nd\033[0m"
content_line "项目地址:\033[32mhttps://github.com/reF1nd/sing-box\033[0m"
content_line ""
content_line "\033[32mDustinWin \033[0m开发\033[36mDustinWin\033[0m"
content_line "开发者地址:\033[32mhttps://github.com/DustinWin\033[0m"
content_line ""
separator_line "="
content_line "特别感谢:\033[36m所有帮助及赞助过此项目的同仁们\033[0m"
separator_line "="
sleep 2 sleep 2
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -190,15 +161,12 @@ getscripts() {
setscripts() { setscripts() {
while true; do while true; do
line_break comp_box "\033[33m注意更新时会停止服务\033[0m" \
separator_line "=" "" \
content_line "\033[33m注意更新时会停止服务\033[0m" "当前脚本版本为:\033[36m$versionsh_l\033[0m" \
content_line "当前脚本版本为:\033[36m$versionsh_l\033[0m" "最新脚本版本为:\033[32m$version_new\033[0m"
content_line "最新脚本版本为:\033[32m$version_new\033[0m" btm_box "1) 立即更新" \
separator_line "-" "0) 返回上级菜单"
content_line "1) 立即更新"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
case "$res" in case "$res" in
"" | 0) "" | 0)
@@ -208,15 +176,12 @@ setscripts() {
# 下载更新 # 下载更新
getscripts getscripts
# 提示 # 提示
msg_alert "\033[32m管理脚本更新成功!\033[0m"
line_break line_break
separator_line "="
content_line "\033[32m管理脚本更新成功!\033[0m"
separator_line "="
exit 0 exit 0
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -226,12 +191,10 @@ setscripts() {
# 手动设置内核架构 # 手动设置内核架构
setcpucore() { setcpucore() {
cpucore_list="armv5 armv7 arm64 386 amd64 mipsle-softfloat mipsle-hardfloat mips-softfloat" cpucore_list="armv5 armv7 arm64 386 amd64 mipsle-softfloat mipsle-hardfloat mips-softfloat"
line_break
separator_line "=" comp_box "\033[31m仅适合脚本无法正确识别核心或核心无法正常运行时使用\033[0m" \
content_line "\033[31m仅适合脚本无法正确识别核心或核心无法正常运行时使用\033[0m" "不知道如何获取核心版本?\033[0m" \
content_line "不知道如何获取核心版本?\033[0m" "请参考:\033[36;4mhttps://juewuy.github.io/bdaz\033[0m"
content_line "请参考:\033[36;4mhttps://juewuy.github.io/bdaz\033[0m"
separator_line "-"
content_line "当前可供在线下载的处理器架构为:" content_line "当前可供在线下载的处理器架构为:"
separator_line "-" separator_line "-"
@@ -245,12 +208,8 @@ setcpucore() {
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
[ -n "$num" ] && setcpucore=$(echo "$cpucore_list" | awk '{print $"'"$num"'"}') [ -n "$num" ] && setcpucore=$(echo "$cpucore_list" | awk '{print $"'"$num"'"}')
if [ -z "$setcpucore" ]; then if [ -z "$setcpucore" ]; then
line_break
separator_line "="
content_line "\033[31m请输入正确的处理器架构\033[0m"
separator_line "="
sleep 1
cpucore="" cpucore=""
msg_alert "\033[31m请输入正确的处理器架构\033[0m"
else else
cpucore=$setcpucore cpucore=$setcpucore
setconfig cpucore "$cpucore" setconfig cpucore "$cpucore"
@@ -260,17 +219,14 @@ setcpucore() {
# 手动指定内核类型 # 手动指定内核类型
setcoretype() { setcoretype() {
while true; do while true; do
line_break
separator_line "="
echo "$crashcore" | grep -q 'singbox' && core_old=singbox || core_old=clash echo "$crashcore" | grep -q 'singbox' && core_old=singbox || core_old=clash
content_line "\033[33m请确认该自定义内核的类型\033[0m" comp_box "\033[33m请确认该自定义内核的类型\033[0m"
separator_line "-" btm_box "1) Mihomo(Meta)" \
content_line "1) Mihomo(Meta)" "2) Singbox-reF1nd" \
content_line "2) Singbox-reF1nd" "3) Singbox" \
content_line "3) Singbox" "4) Clash" \
content_line "4) Clash" "" \
content_line "0) 返回上级菜单" "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) ;; "" | 0) ;;
@@ -288,7 +244,6 @@ setcoretype() {
;; ;;
*) *)
errornum errornum
sleep 1
continue continue
;; ;;
esac esac
@@ -303,15 +258,11 @@ switch_core() {
[ "$core_new" != "$core_old" ] && { [ "$core_new" != "$core_old" ] && {
[ "$dns_mod" = "redir_host" ] && [ "$core_old" = "clash" ] && setconfig dns_mod mix #singbox自动切换dns [ "$dns_mod" = "redir_host" ] && [ "$core_old" = "clash" ] && setconfig dns_mod mix #singbox自动切换dns
[ "$dns_mod" = "mix" ] && [ "$crashcore" = 'clash' -o "$crashcore" = 'clashpre' ] && setconfig dns_mod redir_host #singbox自动切换dns [ "$dns_mod" = "mix" ] && [ "$crashcore" = 'clash' -o "$crashcore" = 'clashpre' ] && setconfig dns_mod redir_host #singbox自动切换dns
line_break comp_box "\033[33m已从$core_old内核切换至$core_new内核\033[0m" \
separator_line "=" "\033[33m二者Geo数据库及yaml/json配置文件不通用\033[0m" \
content_line "\033[33m已从$core_old内核切换至$core_new内核\033[0m" "是否保留相关数据库文件?"
content_line "\033[33m二者Geo数据库及yaml/json配置文件不通用\033[0m" btm_box "1) 保留" \
content_line "是否保留相关数据库文件?" "0) 不保留"
separator_line "-"
content_line "1) 保留"
content_line "0) 不保留"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
[ "$res" = '0' ] && { [ "$res" = '0' ] && {
[ "$core_old" = "clash" ] && { [ "$core_old" = "clash" ] && {
@@ -392,12 +343,9 @@ checkcustcore() {
if [ -s "$TMPDIR"/core.list ]; then if [ -s "$TMPDIR"/core.list ]; then
separator_line "=" separator_line "="
line_break comp_box "内核版本:\033[36m$release_tag\033[0m" \
separator_line "=" "发布时间:\033[33m$release_date\033[0m" \
content_line "内核版本\033[36m$release_tag\033[0m" "更新时间\033[32m$update_date\033[0m"
content_line "发布时间:\033[33m$release_date\033[0m"
content_line "更新时间:\033[32m$update_date\033[0m"
separator_line "-"
content_line "\033[33m请确认内核信息并选择\033[0m" content_line "\033[33m请确认内核信息并选择\033[0m"
separator_line "-" separator_line "-"
grep -oE "$release_tag.*" "$TMPDIR/core.list" | grep -oE "$release_tag.*" "$TMPDIR/core.list" |
@@ -406,10 +354,8 @@ checkcustcore() {
while IFS= read -r line; do while IFS= read -r line; do
content_line "$line" content_line "$line"
done done
btm_box "" \
content_line "" "0) 返回上级菜单"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
0) 0)
@@ -421,12 +367,10 @@ checkcustcore() {
getcore getcore
else else
errornum errornum
sleep 1
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
else else
@@ -455,17 +399,16 @@ setcustcore() {
[ -n "$custcore" ] && { [ -n "$custcore" ] && {
content_line "当前内核为:\033[36m$custcore\033[0m" content_line "当前内核为:\033[36m$custcore\033[0m"
} }
separator_line "-" separator_line "="
content_line "请选择需要使用的核心:" content_line "请选择需要使用的核心:"
separator_line "-" separator_line "-"
content_line "1) \033[36mMetaCubeX/mihomo\033[32m@release\033[0m版本官方内核" btm_box "1) \033[36mMetaCubeX/mihomo\033[32m@release\033[0m版本官方内核" \
content_line "2) \033[36mvernesong/mihomo\033[32m@alpha\033[0m版本内核(支持Smart策略)" "2) \033[36mvernesong/mihomo\033[32m@alpha\033[0m版本内核(支持Smart策略)" \
content_line "3) \033[36mSagerNet/sing-box\033[32m@release\033[0m版本官方内核" "3) \033[36mSagerNet/sing-box\033[32m@release\033[0m版本官方内核" \
content_line "4) Premium-2023.08.17内核(已停止维护)" "4) Premium-2023.08.17内核(已停止维护)" \
content_line "9) \033[33m自定义内核链接 \033[0m" "9) \033[33m自定义内核链接 \033[0m" \
content_line "" "" \
content_line "0) 返回上级菜单" "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -496,13 +439,10 @@ setcustcore() {
checkcustcore checkcustcore
;; ;;
9) 9)
line_break comp_box "请输入自定义内核的链接地址" \
separator_line "=" "(必须是以.tar.gz、.upx或.gz结尾的压缩文件" \
content_line "请输入自定义内核的链接地址" "" \
content_line "(必须是以.tar.gz或.gz结尾的压缩文件" "或者输入 0 返回上级菜单"
content_line ""
content_line "或者输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " link read -r -p "请输入> " link
if [ "$link" = 0 ]; then if [ "$link" = 0 ]; then
continue continue
@@ -514,17 +454,13 @@ setcustcore() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
} }
setziptype() { setziptype() {
line_break comp_box "请选择内核内核分支及压缩方式:\033[0m"
separator_line "="
content_line "请选择内核内核分支及压缩方式:\033[0m"
separator_line "-"
content_line "1) \033[36m最简编译release版本upx压缩\033[0m" content_line "1) \033[36m最简编译release版本upx压缩\033[0m"
sub_content_line "不支持Gvisor、Tailscale、Wireguard、NaiveProxy" sub_content_line "不支持Gvisor、Tailscale、Wireguard、NaiveProxy"
content_line "2) \033[32m标准编译release版本tar.gz压缩\033[0m" content_line "2) \033[32m标准编译release版本tar.gz压缩\033[0m"
@@ -547,7 +483,6 @@ setziptype() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
setconfig zip_type "$zip_type" setconfig zip_type "$zip_type"
@@ -560,18 +495,16 @@ setcore() {
[ -z "$crashcore" ] && crashcore="unknow" [ -z "$crashcore" ] && crashcore="unknow"
[ -z "$zip_type" ] && zip_type="tar.gz" [ -z "$zip_type" ] && zip_type="tar.gz"
echo "$crashcore" | grep -q 'singbox' && core_old=singbox || core_old=clash echo "$crashcore" | grep -q 'singbox' && core_old=singbox || core_old=clash
[ -n "$custcorelink" ] && custcore="$(echo "$custcorelink" | sed 's#.*github.com##; s#/releases/download/#@#; s#-linux.*$##')" [ -n "$custcorelink" ] && custcore="$(echo "$custcorelink" | sed 's#.*github.com##; s#/releases/download/#@#')"
line_break
separator_line "="
[ -z "$cpucore" ] && check_cpucore [ -z "$cpucore" ] && check_cpucore
content_line "当前内核:\033[42;30m$crashcore\033[47;30m $core_v\033[0m" comp_box "当前内核:\033[42;30m$crashcore\033[47;30m $core_v\033[0m" \
content_line "当前系统处理器架构:\033[32m$cpucore\033[0m" "当前系统处理器架构:\033[32m$cpucore\033[0m" \
content_line "\033[36m如需本地上传请将.upx .gz .tar.gz文件上传至 /tmp 目录后重新运行crash命令\033[0m" "\033[36m如需本地上传请将.upx .gz .tar.gz文件上传至 /tmp 目录后重新运行crash命令\033[0m" \
separator_line "-" "" \
content_line "\033[33m请选择需要使用的核心版本\033[0m" "\033[33m请选择需要使用的核心版本\033[0m"
separator_line "-"
content_line "1) \033[43;30mMihomo\033[0m\033[32m$meta_v \033[32m原meta内核支持全面\033[0m \033[33m占用略高\033[0m" content_line "1) \033[43;30mMihomo\033[0m\033[32m$meta_v \033[32m原meta内核支持全面\033[0m \033[33m占用略高\033[0m"
sub_content_line "说明文档:\033[36;4mhttps://wiki.metacubex.one\033[0m" sub_content_line "说明文档:\033[36;4mhttps://wiki.metacubex.one\033[0m"
@@ -586,14 +519,12 @@ setcore() {
content_line "4) \033[43;30mClash\033[0m\033[32m$clash_v \033[32m占用低\033[0m \033[33m不安全,已停止维护\033[0m" content_line "4) \033[43;30mClash\033[0m\033[32m$clash_v \033[32m占用低\033[0m \033[33m不安全,已停止维护\033[0m"
sub_content_line "说明文档:\033[36;4mhttps://lancellc.gitbook.io\033[0m" sub_content_line "说明文档:\033[36;4mhttps://lancellc.gitbook.io\033[0m"
} }
content_line "5) 切换版本分支及压缩方式:\033[32m$zip_type\033[0m" btm_box "5) 切换版本分支及压缩方式\033[32m$zip_type\033[0m" \
content_line "6) \033[36m使用自定义内核\033[0m $custcore" "6) \033[36m使用自定义内核\033[0m $custcore" \
content_line "7) \033[32m更新当前内核\033[0m" "7) \033[32m更新当前内核\033[0m" \
content_line "9) 手动指定处理器架构" "9) 手动指定处理器架构" \
content_line "" "" \
content_line "0 返回上级菜单" "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -601,11 +532,7 @@ setcore() {
;; ;;
1) 1)
[ -d "/jffs" ] && { [ -d "/jffs" ] && {
line_break msg_alert -t 2 "\033[31mMeta内核使用的GeoSite.dat数据库在华硕设备存在被系统误删的问题可能无法使用!\033[0m"
separator_line "="
content_line "\033[31mMeta内核使用的GeoSite.dat数据库在华硕设备存在被系统误删的问题可能无法使用!\033[0m"
separator_line "="
sleep 2
} }
crashcore=meta crashcore=meta
custcorelink='' custcorelink=''
@@ -646,7 +573,6 @@ setcore() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -713,25 +639,19 @@ checkcustgeo() {
while true; do while true; do
[ "$api_tag" = "latest" ] && api_url=latest || api_url="tags/$api_tag" [ "$api_tag" = "latest" ] && api_url=latest || api_url="tags/$api_tag"
[ ! -s "$TMPDIR"/geo.list ] && { [ ! -s "$TMPDIR"/geo.list ] && {
line_break comp_box "\033[32m正在查找可更新的数据库文件......\033[0m"
separator_line "="
content_line "\033[32m正在查找可更新的数据库文件......\033[0m"
separator_line "="
webget "$TMPDIR"/github_api https://api.github.com/repos/${project}/releases/${api_url} webget "$TMPDIR"/github_api https://api.github.com/repos/${project}/releases/${api_url}
release_tag=$(cat "$TMPDIR"/github_api | grep '"tag_name":' | awk -F '"' '{print $4}') release_tag=$(cat "$TMPDIR"/github_api | grep '"tag_name":' | awk -F '"' '{print $4}')
cat "$TMPDIR"/github_api | grep "browser_download_url" | grep -oE 'releases/download.*' | grep -oiE 'geosite.*\.dat"$|country.*\.mmdb"$|.*.mrs|.*.srs' | sed 's|.*/||' | sed 's/"//' >"$TMPDIR"/geo.list cat "$TMPDIR"/github_api | grep "browser_download_url" | grep -oE 'releases/download.*' | grep -oiE 'geosite.*\.dat"$|country.*\.mmdb"$|.*.mrs|.*.srs' | sed 's|.*/||' | sed 's/"//' >"$TMPDIR"/geo.list
rm -rf "$TMPDIR"/github_api rm -rf "$TMPDIR"/github_api
} }
if [ -s "$TMPDIR"/geo.list ]; then if [ -s "$TMPDIR"/geo.list ]; then
comp_box "请选择需要更新的数据库文件:"
line_break
separator_line "="
content_line "请选择需要更新的数据库文件:"
separator_line "-"
awk '{print NR") "$1}' "$TMPDIR/geo.list" | awk '{print NR") "$1}' "$TMPDIR/geo.list" |
while IFS= read -r line; do while IFS= read -r line; do
content_line "$line" content_line "$line"
done done
content_line ""
content_line "0) 返回上级菜单" content_line "0) 返回上级菜单"
separator_line "=" separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
@@ -749,21 +669,15 @@ checkcustgeo() {
getcustgeo getcustgeo
else else
errornum errornum
sleep 1
break break
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
else else
line_break msg_alert "\033[31m查找失败请尽量在服务启动后再使用本功能\033[0m"
separator_line "="
content_line "\033[31m查找失败请尽量在服务启动后再使用本功能\033[0m"
separator_line "="
sleep 1
fi fi
done done
} }
@@ -772,13 +686,11 @@ checkcustgeo() {
setcustgeo() { setcustgeo() {
while true; do while true; do
rm -rf "$TMPDIR"/geo.list rm -rf "$TMPDIR"/geo.list
line_break comp_box "\033[36m此处数据库均源自互联网采集此处致谢各位开发者\033[0m" \
separator_line "=" "\033[32m请点击或复制链接前往项目页面查看具体说明\033[0m" \
content_line "\033[36m此处数据库均源自互联网采集此处致谢各位开发者\033[0m" "\033[31m自定义数据库不支持定时任务及小闪存模式\033[0m" \
content_line "\033[32m请点击或复制链接前往项目页面查看具体说明\033[0m" "\033[33m如遇到网络错误请先启动ShellCrash服务\033[0m"
content_line "\033[31m自定义数据库不支持定时任务及小闪存模式\033[0m"
content_line "\033[33m如遇到网络错误请先启动ShellCrash服务\033[0m"
separator_line "-"
content_line "\033[0m请选择需要更新的数据库项目来源\033[0m" content_line "\033[0m请选择需要更新的数据库项目来源\033[0m"
separator_line "-" separator_line "-"
content_line "1) \033[36;4mhttps://github.com/MetaCubeX/meta-rules-dat\033[0m" content_line "1) \033[36;4mhttps://github.com/MetaCubeX/meta-rules-dat\033[0m"
@@ -797,6 +709,7 @@ setcustgeo() {
sub_content_line "仅限Clash-GeoIP" sub_content_line "仅限Clash-GeoIP"
content_line "9) \033[33m自定义数据库链接 \033[0m" content_line "9) \033[33m自定义数据库链接 \033[0m"
content_line ""
content_line "0) 返回上级菜单" content_line "0) 返回上级菜单"
separator_line "=" separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
@@ -831,13 +744,12 @@ setcustgeo() {
;; ;;
9) 9)
line_break line_break
read -r -p "请输入自定义数据库的链接地址 > " link read -r -p "请输入自定义数据库的链接地址> " link
[ -n "$link" ] && custgeolink="$link" [ -n "$link" ] && custgeolink="$link"
getgeo getgeo
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -845,29 +757,26 @@ setcustgeo() {
setgeo() { setgeo() {
while true; do while true; do
line_break
. $CFG_PATH >/dev/null . $CFG_PATH >/dev/null
[ -n "$cn_mini_v" ] && geo_type_des=精简版 || geo_type_des=全球版 [ -n "$cn_mini_v" ] && geo_type_des=精简版 || geo_type_des=全球版
separator_line "=" comp_box "\033[33m注意Mihomo内核和SingBox内核的数据库文件不通用\033[0m" \
content_line "\033[33m注意Mihomo内核和SingBox内核的数据库文件不通用\033[0m" "在线数据库最新版本(每日同步上游):\033[32m$GeoIP_v\033[0m" \
content_line "在线数据库最新版本(每日同步上游):\033[32m$GeoIP_v\033[0m" "" \
separator_line "-" "请选择需要更新的Geo数据库文件"
content_line "请选择需要更新的Geo数据库文件"
separator_line "-" btm_box "1) CN-IP绕过文件约0.1mb \033[33m$china_ip_list_v\033[0m" \
content_line "1) CN-IP绕过文件0.1mb \033[33m$china_ip_list_v\033[0m" "2) CN-IPV6绕过文件(约30kb \033[33m$china_ipv6_list_v\033[0m" \
content_line "2) CN-IPV6绕过文件约30kb \033[33m$china_ipv6_list_v\033[0m" "" \
content_line "" "3) Mihomo精简版GeoIP_cn数据库约0.1mb \033[33m$cn_mini_v\033[0m" \
content_line "3) Mihomo精简版GeoIP_cn数据库(约0.1mb \033[33m$cn_mini_v\033[0m" "4) Mihomo完整版GeoSite数据库(约5mb \033[33m$geosite_v\033[0m" \
content_line "4) Mihomo完整版GeoSite数据库约5mb \033[33m$geosite_v\033[0m" "" \
content_line "" "5) Mihomo-mrs数据库常用包约1mb,非必要勿用)" \
content_line "5) Mihomo-mrs数据库常用包1mb,非必要勿用)" "6) Singbox-srs数据库常用包0.8mb,非必要勿用)" \
content_line "6) Singbox-srs数据库常用包约0.8mb,非必要勿用)" "" \
content_line "" "8) \033[36m自定义数据库文件\033[0m" \
content_line "8) \033[36m自定义数据库文件\033[0m" "9) \033[31m清理数据库文件\033[0m" \
content_line "9) \033[31m清理数据库文件\033[0m" "" \
content_line "" "0) 返回上级菜单"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -908,14 +817,10 @@ setgeo() {
;; ;;
9) 9)
while true; do while true; do
line_break comp_box "\033[33m这将清理$CRASHDIR目录及/ruleset目录下所有数据库文件\033[0m" \
separator_line "=" "清理后启动服务即可自动下载所需文件"
content_line "\033[33m这将清理$CRASHDIR目录及/ruleset目录下所有数据库文件\033[0m" btm_box "1) 确认清理" \
content_line "清理后启动服务即可自动下载所需文件" "0) 返回上级菜单"
separator_line "-"
content_line "1) 确认清理"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
case "$res" in case "$res" in
"" | 0) "" | 0)
@@ -929,23 +834,17 @@ setgeo() {
setconfig $var setconfig $var
done done
rm -rf "$CRASHDIR"/ruleset/* rm -rf "$CRASHDIR"/ruleset/*
line_break msg_alert "\033[33m所有数据库文件均已清理\033[0m"
separator_line "="
content_line "\033[33m所有数据库文件均已清理\033[0m"
separator_line "="
sleep 1
break break
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -996,16 +895,10 @@ getdb() {
} }
dbdir() { dbdir() {
line_break
separator_line "="
if [ -f /www/clash/CNAME ] || [ -f "$CRASHDIR"/ui/CNAME ]; then if [ -f /www/clash/CNAME ] || [ -f "$CRASHDIR"/ui/CNAME ]; then
content_line "\033[33m检测到已经安装过本地面板\033[0m" comp_box "\033[33m检测到已经安装过本地面板\033[0m"
separator_line "-" btm_box "1) 升级/覆盖安装" \
content_line "请选择操作:" "0) 返回上级菜单"
separator_line "-"
content_line "1) 升级/覆盖安装"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
rm -rf "$BINDIR"/ui rm -rf "$BINDIR"/ui
@@ -1013,21 +906,15 @@ dbdir() {
[ -f "$CRASHDIR"/ui/CNAME ] && rm -rf "$CRASHDIR"/ui && dbdir="$CRASHDIR"/ui [ -f "$CRASHDIR"/ui/CNAME ] && rm -rf "$CRASHDIR"/ui && dbdir="$CRASHDIR"/ui
getdb getdb
else else
line_break msg_alert "\033[33m安装已取消\033[0m"
separator_line "="
separator_line "\033[33m安装已取消\033[0m"
separator_line "="
return 1 return 1
fi fi
elif [ -w /www ] && [ -n "$(pidof nginx)" ]; then elif [ -w /www ] && [ -n "$(pidof nginx)" ]; then
separator_line "请选择面板\033[33m安装目录\033[0m" comp_box "请选择面板\033[33m安装目录\033[0m"
separator_line "-" btm_box "1) 在${CRASHDIR}/ui目录安装" \
content_line " 1) 在${CRASHDIR}/ui目录安装" "2) 在/www/clash目录安装" \
content_line " 2) 在/www/clash目录安装" "" \
content_line "" "0) 返回上级菜单"
separator_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -1045,7 +932,6 @@ dbdir() {
;; ;;
*) *)
errornum errornum
sleep 1
return 1 return 1
;; ;;
esac esac
@@ -1058,25 +944,21 @@ dbdir() {
setdb() { setdb() {
while true; do while true; do
line_break comp_box "\033[36m安装 dashboard 管理面板到本地\033[0m" \
separator_line "=" "\033[32m打开管理面板的速度更快且更稳定\033[0m" \
content_line "\033[36m安装 dashboard 管理面板到本地\033[0m" "" \
content_line "\033[32m打开管理面板的速度更快且更稳定\033[0m" "请选择面板安装类型:"
separator_line "-" btm_box " - - - - - - -维护中- - - - - - -" \
content_line "请选择面板安装类型:" "1) 安装\033[32mzashboard面板\033[0m约2.2mb" \
separator_line "-" "2) 安装\033[32mMetaXD面板\033[0m约1.5mb" \
content_line " - - - - - - -维护中- - - - - - -" "3) 安装\033[32mYacd-Meta魔改面板\033[0m约1.7mb" \
content_line "1) 安装\033[32mzashboard面板\033[0m约2.2mb" " - - - - - -已停止维护- - - - - -" \
content_line "2) 安装\033[32mMetaXD面板\033[0m1.5mb" "4) 安装\033[32m基础面板\033[0m500kb" \
content_line "3) 安装\033[32mYacd-Meta魔改面板\033[0m1.7mb" "5) 安装\033[32mMeta基础面板\033[0m800kb" \
content_line " - - - - - -已停止维护- - - - - -" "6) 安装\033[32mYacd面板\033[0m约1.1mb" \
content_line "4) 安装\033[32m基础面板\033[0m约500kb" "9) \033[31m卸载本地面板\033[0m" \
content_line "5) 安装\033[32mMeta基础面板\033[0m约800kb" "" \
content_line "6) 安装\033[32mYacd面板\033[0m约1.1mb" "0) 返回上级菜单"
content_line "9) \033[31m卸载本地面板\033[0m"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -1110,13 +992,9 @@ setdb() {
;; ;;
9) 9)
while true; do while true; do
line_break comp_box "是否卸载本地面板?"
separator_line "=" btm_box "1) 确认卸载" \
content_line "是否卸载本地面板:" "0) 返回上级菜单"
separator_line "-"
content_line "1) 确认卸载"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
case "$res" in case "$res" in
"" | 0) "" | 0)
@@ -1126,24 +1004,17 @@ setdb() {
rm -rf /www/clash rm -rf /www/clash
rm -rf "$CRASHDIR"/ui rm -rf "$CRASHDIR"/ui
rm -rf "$BINDIR"/ui rm -rf "$BINDIR"/ui
msg_alert "\033[31m面板已经卸载\033[0m"
line_break
separator_line "="
content_line "\033[31m面板已经卸载\033[0m"
separator_line "="
sleep 1
break break
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -1194,7 +1065,7 @@ setcrt() {
content_line "\033[33m检测到系统已经存在根证书文件\033[0m" content_line "\033[33m检测到系统已经存在根证书文件\033[0m"
content_line "\033[33m$crtdir\033[0m" content_line "\033[33m$crtdir\033[0m"
fi fi
separator_line "-" separator_line "="
if [ -f "$crtdir" ]; then if [ -f "$crtdir" ]; then
content_line "1) 覆盖更新" content_line "1) 覆盖更新"
@@ -1214,17 +1085,12 @@ setcrt() {
;; ;;
*) *)
errornum errornum
sleep 1
continue continue
;; ;;
esac esac
else else
line_break msg_alert "\033[33m设备可能尚未安装openssl无法安装证书文件\033[0m"
separator_line "="
content_line "\033[33m设备可能尚未安装openssl无法安装证书文件\033[0m"
separator_line "="
sleep 1
break break
fi fi
@@ -1237,10 +1103,7 @@ saveserver() {
setconfig url_id "$url_id" setconfig url_id "$url_id"
setconfig release_type "$release_type" setconfig release_type "$release_type"
version_new='' version_new=''
line_break msg_alert -t 0 "\033[32m源地址切换成功\033[0m"
separator_line "="
content_line "\033[32m源地址切换成功\033[0m"
separator_line "="
} }
# 安装源 # 安装源
@@ -1254,12 +1117,10 @@ setserver() {
[ "$release_type" = dev ] && release_name=开发版 [ "$release_type" = dev ] && release_name=开发版
[ -n "$url_id" ] && url_name=$(grep "$url_id" "$CRASHDIR"/configs/servers.list 2>/dev/null | awk '{print $2}') || url_name="$update_url" [ -n "$url_id" ] && url_name=$(grep "$url_id" "$CRASHDIR"/configs/servers.list 2>/dev/null | awk '{print $2}') || url_name="$update_url"
separator_line "=" comp_box "\033[30;47m切换ShellCrash版本及更新源地址\033[0m" \
content_line "\033[30;47m切换ShellCrash版本及更新源地址\033[0m" "" \
separator_line "-" "当前版本:\033[4;33m$release_name\033[0m" \
content_line "当前版本:\033[4;33m$release_name\033[0m" "当前源:\n\033[4;32m$url_name\033[0m"
content_line "当前源:\033[4;32m$url_name\033[0m"
separator_line "-"
grep -E "^1|$release_name" "$CRASHDIR"/configs/servers.list | grep -E "^1|$release_name" "$CRASHDIR"/configs/servers.list |
awk '{print NR") "$2}' | awk '{print NR") "$2}' |
@@ -1267,16 +1128,15 @@ setserver() {
content_line "$line" content_line "$line"
done done
content_line btm_box "" \
content_line "a) 切换至\033[32m稳定版-stable\033[0m" "a) 切换至\033[32m稳定版-stable\033[0m" \
content_line "b) 切换至\033[36m公测版-master\033[0m" "b) 切换至\033[36m公测版-master\033[0m" \
content_line "c) 切换至\033[33m开发版-dev\033[0m" "c) 切换至\033[33m开发版-dev\033[0m" \
content_line "" \
content_line "d) 自定义源地址(用于本地源或自建源)" "d) 自定义源地址(用于本地源或自建源)" \
content_line "e) \033[31m版本回退\033[0m" "e) \033[31m版本回退\033[0m" \
content_line "" \
content_line "0) 返回上级菜单" "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -1287,7 +1147,6 @@ setserver() {
url_id_new=$(grep -E "^1|$release_name" "$CRASHDIR"/configs/servers.list | sed -n "$num"p | awk '{print $1}') url_id_new=$(grep -E "^1|$release_name" "$CRASHDIR"/configs/servers.list | sed -n "$num"p | awk '{print $1}')
if [ -z "$url_id_new" ]; then if [ -z "$url_id_new" ]; then
errornum errornum
sleep 1
continue continue
elif [ "$url_id_new" -ge 200 ]; then elif [ "$url_id_new" -ge 200 ]; then
update_url=$(grep -E "^1|$release_name" "$CRASHDIR"/configs/servers.list | sed -n "$num"p | awk '{print $3}') update_url=$(grep -E "^1|$release_name" "$CRASHDIR"/configs/servers.list | sed -n "$num"p | awk '{print $3}')
@@ -1314,17 +1173,13 @@ setserver() {
;; ;;
c) c)
while true; do while true; do
line_break comp_box "\033[33m开发版未经过妥善测试可能依然存在大量bug\033[0m" \
separator_line "=" "\033[33m如果你没有足够的耐心或者测试经验切勿使用此版本\033[0m" \
content_line "\033[33m开发版未经过妥善测试可能依然存在大量bug\033[0m" "请务必加入我们的讨论组:\033[36;4mhttps://t.me/ShellClash\033[0m"
content_line "\033[33m如果你没有足够的耐心或者测试经验切勿使用此版本\033[0m" content_line "是否依然切换到开发版?"
content_line "请务必加入我们的讨论组:\033[36;4mhttps://t.me/ShellClash\033[0m"
separator_line "-" separator_line "-"
content_line "是否依然切换到开发版:" btm_box "1) 确认切换" \
separator_line "-" "0) 返回上级菜单"
content_line "1) 确认切换"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " res read -r -p "请输入对应标号> " res
case "$res" in case "$res" in
"" | 0) "" | 0)
@@ -1338,18 +1193,13 @@ setserver() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
;; ;;
d) d)
line_break comp_box "\033[36m请直接输入个人源路径\033[0m" \
separator_line "=" "或者输入 0 返回上级菜单"
content_line "请直接输入个人源路径"
content_line ""
content_line "或者输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入个人源路径> " update_url read -r -p "请输入个人源路径> " update_url
if [ "$update_url" = 0 ]; then if [ "$update_url" = 0 ]; then
continue continue
@@ -1360,12 +1210,12 @@ setserver() {
fi fi
;; ;;
e) e)
if [ -n "$url_id" ] && [ "$url_id" -lt 200 ]; then
line_break line_break
separator_line "=" separator_line "="
if [ -n "$url_id" ] && [ "$url_id" -lt 200 ]; then
content_line "\033[32m正在获取版本信息......\033[0m" content_line "\033[32m正在获取版本信息......\033[0m"
. "$CRASHDIR"/libs/web_get_lite.sh . "$CRASHDIR"/libs/web_get_lite.sh
web_get_lite https://github.com/juewuy/ShellCrash/tags | grep -o 'releases/tag/.*data'|awk -F '/' '{print $3}'|sed 's/".*//g' > "$TMPDIR"/tags list=$(web_get_lite https://api.github.com/repos/juewuy/ShellCrash/tags | grep -E '"name": "[0-9]' | cut -d '"' -f4)
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
content_line "\033[32m获取版本信息成功\033[0m" content_line "\033[32m获取版本信息成功\033[0m"
separator_line "=" separator_line "="
@@ -1373,25 +1223,18 @@ setserver() {
line_break line_break
separator_line "=" separator_line "="
content_line "\033[31m请选择想要回退至的具体版本\033[0m" content_line "\033[31m请选择想要回退至的具体版本\033[0m"
list_box "$list"
cat "$TMPDIR"/tags | btm_box "" \
awk '{print NR") "$1}' | "0) 返回上级菜单"
while IFS= read -r line; do
content_line "$line"
done
content_line
content_line "0) 返回上级菜单"
read -r -p "请输入对应标号> " num read -r -p "请输入对应标号> " num
if [ -z "$num" ] || [ "$num" = 0 ]; then if [ -z "$num" ] || [ "$num" = 0 ]; then
continue continue
elif [ "$num" -le $(cat "$TMPDIR"/tags 2>/dev/null | awk 'END{print NR}') ]; then elif [ "$num" -le $(echo "$list" | awk 'END{print NR}') ]; then
release_type=$(cat "$TMPDIR"/tags | awk '{print $1}' | sed -n "$num"p) release_type=$(echo "$list" | sed -n "$num"p)
update_url='' update_url=''
saveserver saveserver
else else
errornum errornum
sleep 1
continue continue
fi fi
else else
@@ -1402,16 +1245,13 @@ setserver() {
fi fi
rm -rf "$TMPDIR"/tags rm -rf "$TMPDIR"/tags
else else
content_line "\033[31m当前源不支持版本回退\033[0m" msg_alert "\033[31m当前源不支持版本回退\033[0m" \
content_line "\033[31m请尝试更换其他安装源\033[0m" "\033[31m请尝试更换其他安装源\033[0m"
separator_line "="
sleep 1
continue continue
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done

View File

@@ -2,6 +2,7 @@
[ -z "$CRASHDIR" ] && CRASHDIR=$( cd $(dirname $0);cd ..;pwd) [ -z "$CRASHDIR" ] && CRASHDIR=$( cd $(dirname $0);cd ..;pwd)
. "$CRASHDIR"/libs/web_json.sh . "$CRASHDIR"/libs/web_json.sh
. "$CRASHDIR"/libs/set_config.sh
. "$CRASHDIR"/libs/web_get_lite.sh . "$CRASHDIR"/libs/web_get_lite.sh
. "$CRASHDIR"/menus/running_status.sh . "$CRASHDIR"/menus/running_status.sh
. "$CRASHDIR"/configs/gateway.cfg . "$CRASHDIR"/configs/gateway.cfg
@@ -308,6 +309,9 @@ polling(){
/crash) /crash)
send_menu send_menu
;; ;;
/"$my_alias")
send_menu
;;
/help) /help)
send_help send_help
;; ;;
@@ -316,7 +320,7 @@ polling(){
done done
} }
#send_menu [ "$TG_menupush" = ON ] && send_menu
polling polling

View File

@@ -2,13 +2,11 @@
. "$CRASHDIR"/libs/set_cron.sh . "$CRASHDIR"/libs/set_cron.sh
bot_tg_start(){ bot_tg_start(){
bot_tg_stop
. "$CRASHDIR"/starts/start_legacy.sh . "$CRASHDIR"/starts/start_legacy.sh
start_legacy "$CRASHDIR/menus/bot_tg.sh" 'bot_tg' start_legacy "$CRASHDIR/menus/bot_tg.sh" 'bot_tg'
bot_tg_cron
} }
bot_tg_stop(){ bot_tg_stop(){
cronset 'TG_BOT守护进程' cronload | grep -q 'TG_BOT' && cronset 'TG_BOT'
[ -f "$TMPDIR/bot_tg.pid" ] && kill -TERM "$(cat "$TMPDIR/bot_tg.pid")" 2>/dev/null [ -f "$TMPDIR/bot_tg.pid" ] && kill -TERM "$(cat "$TMPDIR/bot_tg.pid")" 2>/dev/null
killall bot_tg.sh 2>/dev/null killall bot_tg.sh 2>/dev/null
rm -f "$TMPDIR/bot_tg.pid" rm -f "$TMPDIR/bot_tg.pid"

View File

@@ -42,16 +42,23 @@ btm_box() {
separator_line "=" separator_line "="
} }
list_box () { list_box() {
i=1 i=1
printf '%s\n' "$1" | while IFS= read -r f; do printf '%s\n' "$1" | while IFS= read -r f; do
content_line "$i) $f$2" content_line "$i) $f$2"
i=$(( i + 1 )) i=$((i + 1))
done done
} }
# ================================================= common_success() {
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
}
common_failed() {
msg_alert "\033[32m$COMMON_FAILED\033[0m"
}
# =================================================
common_back() { common_back() {
content_line "0) $COMMON_BACK" content_line "0) $COMMON_BACK"
separator_line "=" separator_line "="
@@ -78,9 +85,3 @@ cancel_back() {
content_line "$COMMON_CANCEL" content_line "$COMMON_CANCEL"
sleep 1 sleep 1
} }
common_success() {
separator_line "-"
content_line "\033[32m$COMMON_SUCCESS\033[0m"
sleep 1
}

View File

@@ -49,20 +49,15 @@ set_ddns() {
read -r -p "请输入强制更新间隔(单位:小时默认为24)> " force_interval read -r -p "请输入强制更新间隔(单位:小时默认为24)> " force_interval
[ -z "$force_interval" ] || [ "$force_interval" -lt 1 -o "$force_interval" -gt 240 ] && force_interval=24 [ -z "$force_interval" ] || [ "$force_interval" -lt 1 -o "$force_interval" -gt 240 ] && force_interval=24
line_break comp_box "请核对如下信息:" \
separator_line "=" "" \
content_line "请核对如下信息:" "服务商: \033[32m$service\033[0m" \
content_line "" "域名: \033[32m$domain\033[0m" \
content_line "服务商 \033[32m$service\033[0m" "用户名 \033[32m$username\033[0m" \
content_line "域名: \033[32m$domain\033[0m" "检测间隔: \033[32m$check_interval\033[0m"
content_line "用户名: \033[32m$username\033[0m" btm_box "是否确认添加:"
content_line "检测间隔: \033[32m$check_interval\033[0m" btm_box "1) 是" \
separator_line "=" "0) 否,重新輸入"
content_line "是否确认添加:"
separator_line "="
content_line "1) 是"
content_line "0) 否,重新輸入"
separator_line "="
read -r -p "$COMMON_INPUT> " res read -r -p "$COMMON_INPUT> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
add_ddns add_ddns
@@ -74,23 +69,25 @@ set_ddns() {
set_ddns_service() { set_ddns_service() {
while true; do while true; do
services_dir=/etc/ddns/"$serv" services_dir=/etc/ddns/"$serv"
[ -s "$services_dir" ] || services_dir=/etc/ddns/services
[ -s "$services_dir" ] || services_dir=/usr/share/ddns/list [ -s "$services_dir" ] || services_dir=/usr/share/ddns/list
[ -s "$services_dir" ] || {
msg_alert "\033[33m未找到DDNS列表文件尝试在线获取……\033[0m"
ddns service update >/dev/null || msg_alert "\033[31m下载失败请重试\033[0m"
}
comp_box "\033[32m请选择服务提供商\033[0m" comp_box "\033[32m请选择服务提供商\033[0m"
# cat "$services_dir" | grep -v '^#' | awk '{print NR") " $1}' list=$(awk '/^#/ || !NF {next} {print $1}' "$services_dir")
awk '!/^#/ {print NR") " $1}' "$services_dir" | list_box "$list"
while IFS= read -r line; do
content_line "$line"
done
nr=$(cat "$services_dir" | grep -v '^#' | wc -l) nr=$(echo "$list" | wc -l)
common_back common_back
read -r -p "请输入对应数字> " num read -r -p "请输入对应数字> " num
if [ -z "$num" ] || [ "$num" = 0 ]; then if [ -z "$num" ] || [ "$num" = 0 ]; then
i= i=
break break
elif [ "$num" -gt 0 ] && [ "$num" -lt "$nr" ]; then elif [ "$num" -gt 0 ] && [ "$num" -lt "$nr" ]; then
service_name=$(cat "$services_dir" | grep -v '^#' | awk '{print $1}' | sed -n "$num"p | sed 's/"//g') service_name=$(echo "$list" | sed -n "$num"p | sed 's/"//g')
service=$(echo "$service_name" | sed 's/\./_/g') service=$(echo "$service_name" | sed 's/\./_/g')
set_ddns set_ddns
break break
@@ -103,10 +100,10 @@ set_ddns_service() {
set_ddns_type() { set_ddns_type() {
while true; do while true; do
comp_box "\033[32m请选择网络模式\033[0m" comp_box "\033[32m请选择网络模式\033[0m"
content_line "1) \033[36mIPV4\033[0m" btm_box "1) \033[36mIPV4\033[0m" \
content_line "2) \033[36mIPV6\033[0m" "2) \033[36mIPV6\033[0m" \
content_line "" "" \
common_back "0) $COMMON_BACK"
read -r -p "请输入对应数字> " num read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -135,16 +132,13 @@ rev_ddns_service() {
while true; do while true; do
enabled=$(uci get ddns."$service".enabled) enabled=$(uci get ddns."$service".enabled)
[ "$enabled" = 1 ] && enabled_b="停用" || enabled_b="启用" [ "$enabled" = 1 ] && enabled_b="停用" || enabled_b="启用"
line_break comp_box "1) \033[32m立即更新\033[0m" \
separator_line "=" "2) 编辑当前服务" \
content_line "1) \033[32m立即更新\033[0m" "3) $enabled_b当前服务" \
content_line "2) 编辑当前服务" "4) 移除当前服务" \
content_line "3) $enabled_b当前服务" "5) 查看运行日志" \
content_line "4) 移除当前服务" "" \
content_line "5) 查看运行日志" "0) 返回上级菜单"
content_line ""
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应数字> " num read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -176,11 +170,9 @@ rev_ddns_service() {
;; ;;
5) 5)
line_break line_break
separator_line "=" echo "==========================================================="
cat /var/log/ddns/"$service".log 2>/dev/null cat /var/log/ddns/"$service".log 2>/dev/null
content_line "" echo "==========================================================="
separator_line "="
sleep 1
break break
;; ;;
*) *)

View File

@@ -12,11 +12,8 @@ set_dns_mod() {
[ -z "$hosts_opt" ] && hosts_opt=ON [ -z "$hosts_opt" ] && hosts_opt=ON
[ -z "$dns_protect" ] && dns_protect=ON [ -z "$dns_protect" ] && dns_protect=ON
[ -z "$ecs_subnet" ] && ecs_subnet=OFF [ -z "$ecs_subnet" ] && ecs_subnet=OFF
line_break comp_box "$DNS_CURRENT_MODE\033[47;30m $dns_mod \033[0m" \
separator_line "=" "\033[33m$DNS_RESTART_NOTICE\033[0m"
content_line "$DNS_CURRENT_MODE\033[47;30m $dns_mod \033[0m"
content_line "\033[33m$DNS_RESTART_NOTICE\033[0m"
separator_line "="
content_line "1) 设为MIX$COMMON_MOD\t\033[32m$DNS_MODE_MIX_DESC\033[0m" content_line "1) 设为MIX$COMMON_MOD\t\033[32m$DNS_MODE_MIX_DESC\033[0m"
content_line "2) 设为Route$COMMON_MOD\t\033[32m$DNS_MODE_ROUTE_DESC\033[0m" content_line "2) 设为Route$COMMON_MOD\t\033[32m$DNS_MODE_ROUTE_DESC\033[0m"
content_line "3) 设为Redir$COMMON_MOD\t\033[33m$DNS_MODE_REDIR_DESC\033[0m" content_line "3) 设为Redir$COMMON_MOD\t\033[33m$DNS_MODE_REDIR_DESC\033[0m"
@@ -37,40 +34,32 @@ set_dns_mod() {
break break
;; ;;
1 | 2) 1 | 2)
line_break
separator_line "="
if echo "$crashcore" | grep -q 'singbox' || [ "$crashcore" = meta ]; then if echo "$crashcore" | grep -q 'singbox' || [ "$crashcore" = meta ]; then
[ "$num" = 1 ] && dns_mod=mix || dns_mod=route [ "$num" = 1 ] && dns_mod=mix || dns_mod=route
setconfig dns_mod "$dns_mod" setconfig dns_mod "$dns_mod"
content_line "\033[36m$DNS_SET_OK$dns_mod\033[0m" msg_alert "\033[36m$DNS_SET_OK$dns_mod\033[0m"
else else
econtent_line "\033[31m$DNS_CORE_UNSUPPORTED\033[0m" msg_alert "\033[31m$DNS_CORE_UNSUPPORTED\033[0m"
fi fi
separator_line "="
sleep 1
;; ;;
3) 3)
dns_mod=redir_host dns_mod=redir_host
setconfig dns_mod "$dns_mod" setconfig dns_mod "$dns_mod"
line_break msg_alert "\033[36m$DNS_SET_OK$dns_mod\033[0m"
separator_line "="
content_line "\033[36m$DNS_SET_OK$dns_mod\033[0m"
separator_line "="
;; ;;
4) 4)
while true; do while true; do
line_break line_break
separator_line "=" separator_line "="
if [ "$dns_protect" = ON ]; then if [ "$dns_protect" = ON ]; then
content_line "当前\033[33m已启用\033[0mDNS防泄漏是否确认禁用" content_line "当前\033[33m已启用\033[0mDNS防泄漏是否确认禁用"
else else
content_line "当前\033[33m已禁用\033[0mDNS防泄漏是否确认启用" content_line "当前\033[33m已禁用\033[0mDNS防泄漏是否确认启用"
fi fi
separator_line "=" separator_line "="
content_line "1) 是" btm_box "1) 是" \
content_line "2) 重置为默认值" "2) 重置为默认值" \
content_line "0) 否,返回上级菜单" "0) 否,返回上级菜单"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
0) 0)
@@ -88,17 +77,11 @@ set_dns_mod() {
;; ;;
*) *)
errornum errornum
sleep 1
continue continue
;; ;;
esac esac
setconfig dns_protect "$dns_protect" setconfig dns_protect "$dns_protect"
common_success
line_break
separator_line "="
content_line "\033[32m操作成功\033[0m"
separator_line "="
sleep 1
done done
;; ;;
5) 5)
@@ -106,15 +89,14 @@ set_dns_mod() {
line_break line_break
separator_line "=" separator_line "="
if [ "$hosts_opt" = ON ]; then if [ "$hosts_opt" = ON ]; then
content_line "当前\033[33m已启用\033[0mHosts优化是否确认禁用" content_line "当前\033[33m已启用\033[0mHosts优化是否确认禁用"
else else
content_line "当前\033[33m已禁用\033[0mHosts优化是否确认启用" content_line "当前\033[33m已禁用\033[0mHosts优化是否确认启用"
fi fi
separator_line "=" separator_line "="
content_line "1) 是" btm_box "1) 是" \
content_line "2) 重置为默认值" "2) 重置为默认值" \
content_line "0) 否,返回上级菜单" "0) 否,返回上级菜单"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
0) 0)
@@ -132,17 +114,11 @@ set_dns_mod() {
;; ;;
*) *)
errornum errornum
sleep 1
continue continue
;; ;;
esac esac
setconfig dns_protect "$hosts_opt" setconfig dns_protect "$hosts_opt"
common_success
line_break
separator_line "="
content_line "\033[32m操作成功\033[0m"
separator_line "="
sleep 1
done done
;; ;;
6) 6)
@@ -151,15 +127,14 @@ set_dns_mod() {
line_break line_break
separator_line "=" separator_line "="
if [ "$ecs_subnet" = ON ]; then if [ "$ecs_subnet" = ON ]; then
content_line "当前\033[33m已启用\033[0mHosts优化是否确认禁用" content_line "当前\033[33m已启用\033[0mHosts优化是否确认禁用"
else else
content_line "当前\033[33m已禁用\033[0mHosts优化是否确认启用" content_line "当前\033[33m已禁用\033[0mHosts优化是否确认启用"
fi fi
separator_line "=" separator_line "="
content_line "1) 是" btm_box "1) 是" \
content_line "2) 重置为默认值" "2) 重置为默认值" \
content_line "0) 否,返回上级菜单" "0) 否,返回上级菜单"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
0) 0)
@@ -177,30 +152,21 @@ set_dns_mod() {
;; ;;
*) *)
errornum errornum
sleep 1
continue continue
;; ;;
esac esac
setconfig dns_protect "$ecs_subnet" setconfig dns_protect "$ecs_subnet"
common_success
line_break
separator_line "="
content_line "\033[32m操作成功\033[0m"
separator_line "="
sleep 1
done done
;; ;;
7) 7)
while true; do while true; do
line_break comp_box "\033[31m$DNS_REDIR_WARN\033[0m" \
separator_line "=" "\033[33m$DNS_REDIR_HINT 127.0.0.1:$dns_port\033[0m" \
content_line "\033[31m$DNS_REDIR_WARN\033[0m" "" \
content_line "\033[33m$DNS_REDIR_HINT 127.0.0.1:$dns_port\033[0m" "\033[36m请直接输入旁路由IPV4地址\033[0m" \
content_line "" "或输入 r 重置DNS劫持端口" \
content_line "请直接输入旁路由IPV4地址" "或输入 0 返回上级菜单"
content_line "或输入 r 重置DNS劫持端口"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " num read -r -p "请输入> " num
case "$num" in case "$num" in
0) 0)
@@ -209,33 +175,21 @@ set_dns_mod() {
r) r)
dns_redir_port="$dns_port" dns_redir_port="$dns_port"
setconfig dns_redir_port setconfig dns_redir_port
common_success
line_break
separator_line "="
content_line "\033[32m操作成功\033[0m"
separator_line "="
sleep 1
break break
;; ;;
*) *)
if [ "$num" -ge 1 ] && [ "$num" -lt 65535 ]; then if [ "$num" -ge 1 ] && [ "$num" -lt 65535 ]; then
line_break
separator_line "="
if ckcmd netstat && netstat -ntul | grep -q ":$num "; then if ckcmd netstat && netstat -ntul | grep -q ":$num "; then
dns_redir_port="$num" dns_redir_port="$num"
setconfig dns_redir_port "$dns_redir_port" setconfig dns_redir_port "$dns_redir_port"
content_line "\033[32m操作成功\033[0m" common_success
separator_line "="
sleep 1
break break
else else
content_line "\033[33m$DNS_REDIR_NO_SERVICE\033[0m" msg_alert
separator_line "="
sleep 1
fi fi
else else
errornum errornum
sleep 1
fi fi
;; ;;
esac esac
@@ -249,7 +203,6 @@ set_dns_mod() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -257,13 +210,9 @@ set_dns_mod() {
fake_ip_filter() { fake_ip_filter() {
while true; do while true; do
line_break comp_box "\033[32m$DNS_FAKEIP_DESC\033[0m" \
separator_line "=" "\033[31m$DNS_FAKEIP_TIP\033[0m" \
content_line "\033[32m$DNS_FAKEIP_DESC\033[0m" "\033[36m$DNS_FAKEIP_EXAMPLE\033[0m"
content_line "\033[31m$DNS_FAKEIP_TIP\033[0m"
content_line "\033[36m$DNS_FAKEIP_EXAMPLE\033[0m"
separator_line "="
if [ -s "$CRASHDIR/configs/fake_ip_filter" ]; then if [ -s "$CRASHDIR/configs/fake_ip_filter" ]; then
content_line "\033[33m$DNS_FAKEIP_EXIST\033[0m" content_line "\033[33m$DNS_FAKEIP_EXIST\033[0m"
content_line "" content_line ""
@@ -274,44 +223,35 @@ fake_ip_filter() {
else else
content_line "\033[33m$DNS_FAKEIP_EMPTY\033[0m" content_line "\033[33m$DNS_FAKEIP_EMPTY\033[0m"
fi fi
content_line "" btm_box "" \
content_line "0) 返回上级菜单" "0) 返回上级菜单"
separator_line "="
read -r -p "$DNS_FAKEIP_EDIT> " input read -r -p "$DNS_FAKEIP_EDIT> " input
case "$input" in case "$input" in
"" | 0) "" | 0)
break break
;; ;;
*) *)
line_break
separator_line "="
if [ "$input" -ge 1 ] 2>/dev/null; then if [ "$input" -ge 1 ] 2>/dev/null; then
if sed -i "${input}d" "$CRASHDIR/configs/fake_ip_filter"; then if sed -i "${input}d" "$CRASHDIR/configs/fake_ip_filter"; then
content_line "\033[32m移除成功\033[0m" msg_alert "\033[32m移除成功\033[0m"
else else
content_line "\033[31m移除失败\033[0m" msg_alert "\033[31m移除失败\033[0m"
fi fi
else else
content_line "请确认需要添加的地址:\033[32m$input\033[0m" comp_box "请确认需要添加的地址:\033[32m$input\033[0m"
separator_line "=" btm_box "1) 确认无误" \
content_line "1) 确认无误" "0) 返回上级菜单"
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "$COMMON_INPUT>" res read -r -p "$COMMON_INPUT>" res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
line_break
separator_line "="
if echo "$input" >>"$CRASHDIR/configs/fake_ip_filter"; then if echo "$input" >>"$CRASHDIR/configs/fake_ip_filter"; then
content_line "\033[32m添加成功\033[0m" msg_alert "\033[32m添加成功\033[0m"
else else
content_line "\033[31m添加失败\033[0m" msg_alert "\033[31m添加失败\033[0m"
fi fi
else else
break break
fi fi
fi fi
separator_line "="
sleep 1
;; ;;
esac esac
done done
@@ -320,46 +260,36 @@ fake_ip_filter() {
# DNS详细设置 # DNS详细设置
set_dns_adv() { set_dns_adv() {
while true; do while true; do
line_break comp_box "\033[31m$DNS_ADV_SINGBOX_LIMIT\033[0m" \
separator_line "=" "$DNS_ADV_SPLIT" \
content_line "\033[31m$DNS_ADV_SINGBOX_LIMIT\033[0m" "\033[33m$DNS_ADV_CERT\033[0m" \
content_line "$DNS_ADV_SPLIT" "" \
content_line "\033[33m$DNS_ADV_CERT\033[0m" "DIRECT-DNS" \
content_line "" "\033[32m$dns_nameserver\033[0m" \
content_line "DIRECT-DNS" "" \
content_line "\033[32m$dns_nameserver\033[0m" "PROXY-DNS" \
content_line "" "\033[36m$dns_fallback\033[0m" \
"" \
content_line "PROXY-DNS" "DEFAULT-DNS" \
content_line "\033[36m$dns_fallback\033[0m" "\033[33m$dns_resolver\033[0m" \
content_line "" ""
btm_box "1) $DNS_ADV_EDIT_DIRECT" \
content_line "DEFAULT-DNS" "2) $DNS_ADV_EDIT_PROXY" \
content_line "\033[33m$dns_resolver\033[0m" "3) $DNS_ADV_EDIT_DEFAULT" \
content_line "" "4) \033[32m$DNS_ADV_AUTO_ENCRYPT\033[0m" \
"9) \033[33m$DNS_ADV_RESET\033[0m" \
separator_line "=" "" \
content_line "1) $DNS_ADV_EDIT_DIRECT" "0) $COMMON_BACK"
content_line "2) $DNS_ADV_EDIT_PROXY" read -r -p "$COMMON_INPUT> " num
content_line "3) $DNS_ADV_EDIT_DEFAULT"
content_line "4) \033[32m$DNS_ADV_AUTO_ENCRYPT\033[0m"
content_line "9) \033[33m$DNS_ADV_RESET\033[0m"
content_line "0) $COMMON_BACK"
separator_line "="
read -r -p "$COMMON_INPUT > " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
1) 1)
line_break comp_box "当前DIRECT-DNS\033[32m$dns_nameserver\033[0m"
separator_line "=" btm_box "\033[36m请直接输入新的DIRECT-DNS地址\033[0m" \
content_line "当前DIRECT-DNS\033[32m$dns_nameserver\033[0m" "或输入 r 重置DIRECT-DNS地址" \
separator_line "=" "或输入 0 返回上级菜单"
content_line "请直接输入新的DIRECT-DNS地址"
content_line "或输入 r 重置DIRECT-DNS地址"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " res read -r -p "请输入> " res
case "$res" in case "$res" in
0) 0)
@@ -368,34 +298,24 @@ set_dns_adv() {
r) r)
dns_nameserver="127.0.0.1" dns_nameserver="127.0.0.1"
setconfig dns_nameserver "'$dns_nameserver'" setconfig dns_nameserver "'$dns_nameserver'"
common_success
line_break
separator_line "="
content_line "\033[32m操作成功\033[0m"
;; ;;
*) *)
dns_nameserver=$(echo "$res" | sed 's#|#,\ #g') dns_nameserver=$(echo "$res" | sed 's#|#,\ #g')
line_break
separator_line "="
if [ -n "$dns_nameserver" ]; then if [ -n "$dns_nameserver" ]; then
setconfig dns_nameserver "'$dns_nameserver'" setconfig dns_nameserver "'$dns_nameserver'"
content_line "\033[32m操作成功\033[0m" common_success
else else
ontent_line "\033[32m操作失败\033[0m" common_failed
fi fi
;; ;;
esac esac
separator_line "="
;; ;;
2) 2)
line_break comp_box "当前PROXY-DNS\033[32m$dns_fallback\033[0m"
separator_line "=" btm_box "\033[36m请直接输入新的PROXY-DNS地址\033[0m" \
content_line "当前PROXY-DNS\033[32m$dns_fallback\033[0m" "或输入 r 重置PROXY-DNS地址" \
separator_line "=" "或输入 0 返回上级菜单"
content_line "请直接输入新的PROXY-DNS地址"
content_line "或输入 r 重置PROXY-DNS地址"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " res read -r -p "请输入> " res
case "$res" in case "$res" in
0) 0)
@@ -404,32 +324,24 @@ set_dns_adv() {
r) r)
dns_fallback="1.1.1.1, 8.8.8.8" dns_fallback="1.1.1.1, 8.8.8.8"
setconfig dns_fallback "'$dns_fallback'" setconfig dns_fallback "'$dns_fallback'"
line_break common_success
separator_line "="
content_line "\033[32m操作成功\033[0m"
;; ;;
*) *)
dns_fallback=$(echo "$res" | sed 's#|#,\ #g') dns_fallback=$(echo "$res" | sed 's#|#,\ #g')
line_break
separator_line "="
if [ -n "$dns_fallback" ]; then if [ -n "$dns_fallback" ]; then
setconfig dns_fallback "'$dns_fallback'" setconfig dns_fallback "'$dns_fallback'"
content_line "\033[32m操作成功\033[0m" common_success
else else
ontent_line "\033[32m操作失败\033[0m" common_failed
fi fi
;; ;;
esac esac
separator_line "="
;; ;;
3) 3)
line_break comp_box "当前DEFAULT-DNS\033[32m$dns_resolver\033[0m"
separator_line "=" btm_box "\033[36m请直接输入新的DEFAULT-DNS地址\033[0m" \
content_line "当前DEFAULT-DNS\033[32m$dns_resolver\033[0m" "或输入 r 重置DEFAULT-DNS地址" \
separator_line "=" "或输入 0 返回上级菜单"
content_line "请直接输入新的DEFAULT-DNS地址"
content_line "或输入 r 重置DEFAULT-DNS地址"
content_line "或输入 0 返回上级菜单"
separator_line "=" separator_line "="
read -r -p "请输入> " res read -r -p "请输入> " res
case "$res" in case "$res" in
@@ -439,23 +351,18 @@ set_dns_adv() {
"r") "r")
dns_resolver="223.5.5.5, 2400:3200::1" dns_resolver="223.5.5.5, 2400:3200::1"
setconfig dns_resolver "'$dns_resolver'" setconfig dns_resolver "'$dns_resolver'"
line_break common_failed
separator_line "="
content_line "\033[32m操作成功\033[0m"
;; ;;
*) *)
line_break
separator_line "="
if echo "$res" | grep -qE '://.*::'; then if echo "$res" | grep -qE '://.*::'; then
content_line "\033[31m$DNS_IPV6_NOT_SUPPORT\033[0m" msg_alert "\033[31m$DNS_IPV6_NOT_SUPPORT\033[0m"
else else
dns_resolver=$(echo "$res" | sed 's#|#,\ #g') dns_resolver=$(echo "$res" | sed 's#|#,\ #g')
setconfig dns_resolver "'$dns_resolver'" setconfig dns_resolver "'$dns_resolver'"
content_line "\033[32m$COMMON_SUCCESS\033[0m" msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
fi fi
;; ;;
esac esac
separator_line "="
;; ;;
4) 4)
line_break line_break
@@ -478,15 +385,11 @@ set_dns_adv() {
setconfig dns_fallback setconfig dns_fallback
setconfig dns_resolver setconfig dns_resolver
. "$CRASHDIR/libs/get_config.sh" . "$CRASHDIR/libs/get_config.sh"
line_break common_success
separator_line "="
content_line "\033[32m$COMMON_SUCCESS\033[0m"
separator_line "="
;; ;;
*) *)
errornum errornum
;; ;;
esac esac
sleep 1
done done
} }

View File

@@ -12,16 +12,14 @@ set_fw_filter() {
[ -z "$cn_ip_route" ] && cn_ip_route=OFF [ -z "$cn_ip_route" ] && cn_ip_route=OFF
touch "$CRASHDIR"/configs/mac "$CRASHDIR"/configs/ip_filter touch "$CRASHDIR"/configs/mac "$CRASHDIR"/configs/ip_filter
[ -z "$(cat "$CRASHDIR"/configs/mac "$CRASHDIR"/configs/ip_filter 2>/dev/null)" ] && mac_return=OFF || mac_return=ON [ -z "$(cat "$CRASHDIR"/configs/mac "$CRASHDIR"/configs/ip_filter 2>/dev/null)" ] && mac_return=OFF || mac_return=ON
line_break comp_box "1) 过滤非常用端口: \033[36m$common_ports\033[0m ———用于过滤P2P流量" \
separator_line "=" "2) 过滤局域网设备: \033[36m$mac_return\033[0m ———使用黑/白名单进行过滤" \
content_line "1) 过滤非常用端口: \033[36m$common_ports\033[0m ———用于过滤P2P流量" "3) 过滤QUIC协议 \033[36m$quic_rj\033[0m ———优化视频性能" \
content_line "2) 过滤局域网设备: \033[36m$mac_return\033[0m ———使用黑/白名单进行过滤" "4) 过滤CN_IP(4&6)列表:\033[36m$cn_ip_route\033[0m ———优化性能" \
content_line "3) 过滤QUIC协议 \033[36m$quic_rj\033[0m ———优化视频性能" "5) 自定义透明路由ipv4网段适合vlan等复杂网络环境" \
content_line "4) 过滤CN_IP(4/6)列表:\033[36m$cn_ip_route\033[0m ———优化性能" "6) 自定义保留地址ipv4网段需要以保留地址为访问目标的环境" \
content_line "5) 自定义透明路由ipv4网段适合vlan等复杂网络环境" "" \
content_line "6) 自定义保留地址ipv4网段需要以保留地址为访问目标的环境" "0) $COMMON_BACK"
content_line ""
common_back
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -30,9 +28,8 @@ set_fw_filter() {
1) 1)
if [ -n "$(pidof CrashCore)" ] && [ "$firewall_mod" = 'iptables' ]; then if [ -n "$(pidof CrashCore)" ] && [ "$firewall_mod" = 'iptables' ]; then
comp_box "切换时将停止服务,是否继续:" comp_box "切换时将停止服务,是否继续:"
content_line "1) 是" btm_box "1) 是" \
content_line "0) 否,返回上级菜单" "0) 否,返回上级菜单"
separator_line "="
read -r -p "$COMMON_INPUT> " res read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && "$CRASHDIR"/start.sh stop && set_common_ports [ "$res" = 1 ] && "$CRASHDIR"/start.sh stop && set_common_ports
else else
@@ -76,30 +73,7 @@ set_fw_filter() {
set_cust_host_ipv4 set_cust_host_ipv4
;; ;;
6) 6)
while true; do set_reserve_ipv4
[ -z "$reserve_ipv4" ] && reserve_ipv4="0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 100.64.0.0/10 169.254.0.0/16 172.16.0.0/12 192.168.0.0/16 224.0.0.0/4 240.0.0.0/4"
comp_box "\033[33m注意地址必须是空格分隔错误的设置可能导致网络回环或启动报错请务必谨慎\033[0m" \
"" \
"当前网段:" \
"\033[36m$reserve_ipv4\033[0m"
btm_box "请直接输入自定义保留地址ipv4网段" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " text
if [ "$text" = 0 ]; then
break
elif
echo "$text" | grep -Eq "(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])/(3[0-2]|[1-2]?[0-9]))( +|$)+"
then
reserve_ipv4="$text"
if setconfig reserve_ipv4 "'$reserve_ipv4'"; then
msg_alert "已将保留地址网段设为:\033[32m$reserve_ipv4\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
else
msg_alert "\033[31m输入有误请重新输入\033[0m"
fi
done
;; ;;
*) *)
errornum errornum
@@ -119,13 +93,13 @@ set_common_ports() {
content_line "当前已放行端口:\033[36m$multiport\033[0m" content_line "当前已放行端口:\033[36m$multiport\033[0m"
fi fi
separator_line "=" separator_line "="
content_line "1) 启用/关闭端口过滤: \033[36m$common_ports\033[0m" btm_box "1) 启用/关闭端口过滤: \033[36m$common_ports\033[0m" \
content_line "2) 添加放行端口" "2) 添加放行端口" \
content_line "3) 移除指定放行端口" "3) 移除指定放行端口" \
content_line "4) 重置默认放行端口" "4) 重置默认放行端口" \
content_line "5) 重置为旧版放行端口" "5) 重置为旧版放行端口" \
content_line "" "" \
common_back "0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -151,7 +125,7 @@ set_common_ports() {
comp_box "\033[31m最多支持设置放行15个端口请先减少一些\033[0m" comp_box "\033[31m最多支持设置放行15个端口请先减少一些\033[0m"
else else
comp_box "当前已放行端口:\033[36m$multiport\033[0m" comp_box "当前已放行端口:\033[36m$multiport\033[0m"
btm_box "请直接输入要放行的端口号\n每次只能输入一个端口号切勿一次添加多个端口号" \ btm_box "\033[36m请直接输入要放行的端口号\033[0m\n每次只能输入一个端口号切勿一次添加多个端口号" \
"或输入 0 返回上级菜单" "或输入 0 返回上级菜单"
read -r -p "请输入> " port read -r -p "请输入> " port
if [ "$port" = 0 ]; then if [ "$port" = 0 ]; then
@@ -175,7 +149,7 @@ set_common_ports() {
3) 3)
while true; do while true; do
comp_box "当前已放行端口:\033[36m$multiport\033[0m" comp_box "当前已放行端口:\033[36m$multiport\033[0m"
btm_box "请直接输入要移除的端口号\n每次只能输入一个端口号切勿一次添加多个端口号" \ btm_box "\033[36m请直接输入要移除的端口号\033[0m\n每次只能输入一个端口号切勿一次添加多个端口号" \
"或输入 0 返回上级菜单" "或输入 0 返回上级菜单"
read -r -p "请输入> " port read -r -p "请输入> " port
if [ "$port" = 0 ]; then if [ "$port" = 0 ]; then
@@ -219,16 +193,17 @@ set_common_ports() {
done done
} }
# 自定义ipv4透明路由网段 # 自定义ipv4透明路由、保留地址网段
set_cust_host_ipv4() { set_cust_host_ipv4() {
while true; do while true; do
[ -z "$replace_default_host_ipv4" ] && replace_default_host_ipv4="OFF" [ -z "$replace_default_host_ipv4" ] && replace_default_host_ipv4="OFF"
. "$CRASHDIR"/starts/fw_getlanip.sh && getlanip . "$CRASHDIR"/starts/fw_getlanip.sh && getlanip
comp_box "当前默认透明路由的网段为:\033[32m$host_ipv4\033[0m" \ comp_box "当前默认透明路由的网段为:\033[32m$host_ipv4\033[0m" \
"当前已添加的自定义网段为:\033[36m$cust_host_ipv4\033[0m" "当前已添加的自定义网段为:\033[36m$cust_host_ipv4\033[0m"
content_line "1) 移除所有自定义网段" btm_box "1) 移除所有自定义网段" \
content_line "2) 使用自定义网段覆盖默认网段 \033[36m$replace_default_host_ipv4\033[0m" "2) 使用自定义网段覆盖默认网段 \033[36m$replace_default_host_ipv4\033[0m" \
common_back "" \
"0) $COMMON_BACK"
read -r -p "请输入对应的序号或需要额外添加的网段> " text read -r -p "请输入对应的序号或需要额外添加的网段> " text
case "$text" in case "$text" in
"" | 0) "" | 0)
@@ -256,7 +231,7 @@ set_cust_host_ipv4() {
fi fi
;; ;;
*) *)
if [ -n "$(echo "$text" | grep -Eo '^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}'$)" ] && echo "$cust_host_ipv4" | grep -q "$text"; then if echo "$text" | grep -Eq '^([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2}' && [ -z "$(echo $cust_host_ipv4 | grep "$text")" ]; then
cust_host_ipv4="$cust_host_ipv4 $text" cust_host_ipv4="$cust_host_ipv4 $text"
if setconfig cust_host_ipv4 "'$cust_host_ipv4'"; then if setconfig cust_host_ipv4 "'$cust_host_ipv4'"; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m" msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
@@ -271,6 +246,45 @@ set_cust_host_ipv4() {
done done
} }
set_reserve_ipv4() {
while true; do
[ -z "$reserve_ipv4" ] && reserve_ipv4="0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 100.64.0.0/10 169.254.0.0/16 172.16.0.0/12 192.168.0.0/16 224.0.0.0/4 240.0.0.0/4"
comp_box "\033[33m注意地址必须是空格分隔错误的设置可能导致网络回环或启动报错请务必谨慎\033[0m" \
"" \
"当前网段:" \
"\033[36m$reserve_ipv4\033[0m"
btm_box "\033[36m请直接输入自定义保留地址ipv4网段\033[0m" \
"或输入 1 重置默认网段" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " text
case "$text" in
"" | 0)
break
;;
1)
unset reserve_ipv4
if setconfig reserve_ipv4; then
msg_alert "\033[32m$COMMON_SUCCESS\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
;;
*)
if echo "$text" | grep -Eq "(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])/(3[0-2]|[1-2]?[0-9]))( +|$)+"; then
reserve_ipv4="$text"
if setconfig reserve_ipv4 "'$reserve_ipv4'"; then
msg_alert "已将保留地址网段设为:\033[32m$reserve_ipv4\033[0m"
else
msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi
else
msg_alert "\033[31m输入有误请重新输入\033[0m"
fi
;;
esac
done
}
# 局域网设备过滤 # 局域网设备过滤
fw_filter_lan() { fw_filter_lan() {
get_devinfo() { get_devinfo() {
@@ -278,7 +292,6 @@ fw_filter_lan() {
dev_mac=$(cat "$dhcpdir" | grep " $dev " | awk '{print $2}') && [ -z "$dev_mac" ] && dev_mac=$dev dev_mac=$(cat "$dhcpdir" | grep " $dev " | awk '{print $2}') && [ -z "$dev_mac" ] && dev_mac=$dev
dev_name=$(cat "$dhcpdir" | grep " $dev " | awk '{print $4}') && [ -z "$dev_name" ] && dev_name='未知设备' dev_name=$(cat "$dhcpdir" | grep " $dev " | awk '{print $4}') && [ -z "$dev_name" ] && dev_name='未知设备'
} }
add_mac() { add_mac() {
while true; do while true; do
comp_box "手动输入mac地址时仅支持\033[32mxx:xx:xx:xx:xx:xx\033[0m的形式" comp_box "手动输入mac地址时仅支持\033[32mxx:xx:xx:xx:xx:xx\033[0m的形式"
@@ -291,7 +304,6 @@ fw_filter_lan() {
else else
content_line "暫未添加任何mac地址" content_line "暫未添加任何mac地址"
fi fi
separator_line "=" separator_line "="
content_line "序号 \033[33m设备IP 设备mac地址 设备名称\033[0m" content_line "序号 \033[33m设备IP 设备mac地址 设备名称\033[0m"
if [ -s "$dhcpdir" ]; then if [ -s "$dhcpdir" ]; then
@@ -302,9 +314,8 @@ fw_filter_lan() {
else else
content_line "无纪录" content_line "无纪录"
fi fi
btm_box "" \
content_line "" "0) $COMMON_BACK"
common_back
read -r -p "请输入对应序号或直接输入mac地址> " num read -r -p "请输入对应序号或直接输入mac地址> " num
if [ -z "$num" ] || [ "$num" = 0 ]; then if [ -z "$num" ] || [ "$num" = 0 ]; then
i= i=
@@ -331,7 +342,7 @@ fw_filter_lan() {
add_ip() { add_ip() {
while true; do while true; do
comp_box "手动输入时仅支持 \033[32m192.168.1.0/24\033[0m 或 \033[32m192.168.1.0\033[0m 的形式" \ comp_box "手动输入时仅支持 \033[32m192.168.1.0/24\033[0m 或 \033[32m192.168.1.0\033[0m 的形式" \
"不支持ipv6地址过滤如有需求请使用mac地址过滤" "不支持ipv6地址过滤可能导致过滤失败,建议使用mac地址过滤"
content_line "已添加的IP地址" content_line "已添加的IP地址"
content_line "" content_line ""
if [ -s "$CRASHDIR/configs/ip_filter" ]; then if [ -s "$CRASHDIR/configs/ip_filter" ]; then
@@ -352,9 +363,8 @@ fw_filter_lan() {
else else
content_line "无纪录" content_line "无纪录"
fi fi
btm_box "" \
content_line "" "0) $COMMON_BACK"
common_back
read -r -p "请输入对应序号或直接输入IP地址段> " num read -r -p "请输入对应序号或直接输入IP地址段> " num
if [ -z "$num" ] || [ "$num" = 0 ]; then if [ -z "$num" ] || [ "$num" = 0 ]; then
i= i=
@@ -393,8 +403,8 @@ fw_filter_lan() {
"$i" "$dev_ip" "$dev_mac" "$dev_name")" "$i" "$dev_ip" "$dev_mac" "$dev_name")"
i=$((i + 1)) i=$((i + 1))
done done
content_line "" btm_box "" \
common_back "0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
mac_filter_rows=$(cat "$CRASHDIR"/configs/mac 2>/dev/null | wc -l) mac_filter_rows=$(cat "$CRASHDIR"/configs/mac 2>/dev/null | wc -l)
ip_filter_rows=$(cat "$CRASHDIR"/configs/ip_filter 2>/dev/null | wc -l) ip_filter_rows=$(cat "$CRASHDIR"/configs/ip_filter 2>/dev/null | wc -l)
@@ -432,7 +442,7 @@ fw_filter_lan() {
comp_box "\033[30;47m请在此添加或移除设备\033[0m" \ comp_box "\033[30;47m请在此添加或移除设备\033[0m" \
"" \ "" \
"当前过滤方式为:\033[33m$fw_filter_lan_type模式\033[0m" \ "当前过滤方式为:\033[33m$macfilter_type模式\033[0m" \
"仅列表内设备流量\033[36m$fw_filter_lan_scrip经过\033[0m内核" "仅列表内设备流量\033[36m$fw_filter_lan_scrip经过\033[0m内核"
if [ -n "$(cat "$CRASHDIR"/configs/mac)" ]; then if [ -n "$(cat "$CRASHDIR"/configs/mac)" ]; then
content_line "当前已过滤设备为:" content_line "当前已过滤设备为:"
@@ -450,13 +460,13 @@ fw_filter_lan() {
done done
separator_line "=" separator_line "="
fi fi
content_line "1) 切换为\033[33m$fw_filter_lan_over模式\033[0m" btm_box "1) 切换为\033[33m$fw_filter_lan_over模式\033[0m" \
content_line "2) \033[32m添加指定设备mac地址\033[0m" "2) \033[32m添加指定设备mac地址\033[0m" \
content_line "3) \033[32m添加指定设备IP地址网段\033[0m" "3) \033[32m添加指定设备IP地址网段\033[0m" \
content_line "4) \033[36m移除指定设备\033[0m" "4) \033[36m移除指定设备\033[0m" \
content_line "9) \033[31m清空整个列表\033[0m" "9) \033[31m清空整个列表\033[0m" \
content_line "" "" \
common_back "0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
@@ -465,7 +475,7 @@ fw_filter_lan() {
1) 1)
macfilter_type=$fw_filter_lan_over macfilter_type=$fw_filter_lan_over
if setconfig macfilter_type $macfilter_type; then if setconfig macfilter_type $macfilter_type; then
msg_alert "\033[32m已切换为$fw_filter_lan_type模式\033[0m" msg_alert "\033[32m已切换为$macfilter_type模式\033[0m"
else else
msg_alert "\033[31m$COMMON_FAILED\033[0m" msg_alert "\033[31m$COMMON_FAILED\033[0m"
fi fi

View File

@@ -4,42 +4,30 @@
[ -n "$__IS_MODULE_OVERRIDE" ] && return [ -n "$__IS_MODULE_OVERRIDE" ] && return
__IS_MODULE_OVERRIDE=1 __IS_MODULE_OVERRIDE=1
YAMLSDIR="$CRASHDIR"/yamls
JSONSDIR="$CRASHDIR"/jsons
# 配置文件覆写 # 配置文件覆写
override() { override() {
while true; do while true; do
[ -z "$rule_link" ] && rule_link=1 [ -z "$rule_link" ] && rule_link=1
[ -z "$server_link" ] && server_link=1 [ -z "$server_link" ] && server_link=1
echo "-----------------------------------------------" comp_box "\033[30;47m 欢迎使用配置文件覆写功能!\033[0m"
echo -e "\033[30;47m 欢迎使用配置文件覆写功能!\033[0m" content_line "2) 管理\033[36m自定义规则\033[0m"
echo "-----------------------------------------------"
echo -e " 1 自定义\033[32m端口及秘钥\033[0m"
echo -e " 2 管理\033[36m自定义规则\033[0m"
echo "$crashcore" | grep -q 'singbox' || { echo "$crashcore" | grep -q 'singbox' || {
echo -e " 3 管理\033[33m自定义节点\033[0m" content_line "3) 管理\033[33m自定义节点\033[0m"
echo -e " 4 管理\033[36m自定义策略组\033[0m" content_line "4) 管理\033[36m自定义策略组\033[0m"
} }
echo -e " 5 \033[32m自定义\033[0m高级功能" content_line "5) \033[32m自定义\033[0m高级功能"
[ "$disoverride" != 1 ] && echo -e " 9 \033[33m禁用\033[0m配置文件覆写" [ "$disoverride" != 1 ] && content_line "9) \033[33m禁用\033[0m配置文件覆写"
echo "-----------------------------------------------" content_line ""
[ "$inuserguide" = 1 ] || echo -e " 0 返回上级菜单" content_line "0) 返回上级菜单"
read -p "请输入对应数字 > " num separator_line "="
read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
1)
if [ -n "$(pidof CrashCore)" ]; then
echo "-----------------------------------------------"
echo -e "\033[33m检测到服务正在运行需要先停止服务\033[0m"
read -p "是否停止服务?(1/0) > " res
if [ "$res" = "1" ]; then
"$CRASHDIR"/start.sh stop
setport
fi
else
setport
fi
;;
2) 2)
setrules setrules
;; ;;
@@ -50,117 +38,126 @@ override() {
setgroups setgroups
;; ;;
5) 5)
echo "$crashcore" | grep -q 'singbox' && set_singbox_adv || set_clash_adv if echo "$crashcore" | grep -q 'singbox'; then
set_singbox_adv
else
set_clash_adv
fi
sleep 3 sleep 3
;; ;;
9) 9)
echo "-----------------------------------------------" comp_box "\033[33m此功能可能会导致严重问题启用后脚本中大部分功能都将禁用\033[0m" \
echo -e "\033[33m此功能可能会导致严重问题启用后脚本中大部分功能都将禁用\033[0m" "如果你不是非常了解$crashcore的运行机制,切勿开启\033[0m" \
echo -e "如果你不是非常了解$crashcore的运行机制,切勿开启\033[0m" "\033[33m继续后如出现任何问题请务必自行解决一切提问恕不受理\033[0m"
echo -e "\033[33m继续后如出现任何问题请务必自行解决一切提问恕不受理\033[0m"
echo "-----------------------------------------------"
sleep 2 sleep 2
read -p "我确认遇到问题可以自行解决[1/0] > " res btm_box "1) 我确认遇到问题可以自行解决" \
"0) 返回上级菜单"
read -r -p "$COMMON_INPUT> " res
[ "$res" = '1' ] && { [ "$res" = '1' ] && {
disoverride=1 disoverride=1
setconfig disoverride $disoverride if setconfig disoverride $disoverride; then
echo "-----------------------------------------------" common_success
echo -e "\033[32m设置成功\033[0m" else
common_failed
fi
} }
;; ;;
*) *)
errornum errornum
sleep 1
break
;; ;;
esac esac
done done
} }
setrules() { # 自定义规则 # 自定义规则
setrules() {
set_rule_type() { set_rule_type() {
echo "-----------------------------------------------" comp_box "\033[33m请选择规则类型\033[0m"
echo -e "\033[33m请选择规则类型\033[0m" printf '%s\n' "$rule_type" |
echo "$rule_type" | awk -F ' ' '{for(i=1;i<=NF;i++){print i" "$i}}' awk '{for (i = 1; i <= NF; i++) print i") " $i}' |
echo -e " 0 返回上级菜单" while IFS= read -r line; do
read -p "请输入对应数字 > " num content_line "$line"
done
btm_box "" \
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) ;; "" | 0) ;;
[0-9]*) [0-9]*)
if [ "$num" -gt $(echo $rule_type | awk -F " " '{print NF}') ]; then if [ "$num" -gt $(echo $rule_type | awk -F " " '{print NF}') ]; then
errornum errornum
sleep 1
else else
rule_type_set=$(echo "$rule_type" | cut -d' ' -f"$num") rule_type_set=$(echo "$rule_type" | cut -d' ' -f"$num")
echo "-----------------------------------------------" comp_box "\033[33m请输入规则语句\n可以是域名、泛域名、IP网段或者其他匹配规则类型的内容\033[0m"
echo -e "\033[33m请输入规则语句可以是域名、泛域名、IP网段或者其他匹配规则类型的内容\033[0m" read -r -p "请输入对应规则> " rule_state_set
read -p "请输入对应规则 > " rule_state_set
if [ -n "$rule_state_set" ]; then if [ -n "$rule_state_set" ]; then
set_group_type set_group_type
else else
errornum errornum
slepp 1
fi fi
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
} }
set_group_type() { set_group_type() {
echo "-----------------------------------------------" comp_box "\033[36m请选择具体规则\033[0m" \
echo -e "\033[36m请选择具体规则\033[0m" "\033[33m此处规则读取自现有配置文件如果你后续更换配置文件时运行出错请尝试重新添加\033[0m"
echo -e "\033[33m此处规则读取自现有配置文件如果你后续更换配置文件时运行出错请尝试重新添加\033[0m" printf '%s\n' "$rule_group" |
echo "$rule_group" | awk -F '#' '{for(i=1;i<=NF;i++){print i" "$i}}' awk -F '#' '{for (i = 1; i <= NF; i++) print i") " $i}' |
echo -e " 0 返回上级菜单" while IFS= read -r line; do
read -p "请输入对应数字 > " num content_line "$line"
done
btm_box "" \
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) ;; "" | 0) ;;
[0-9]*) [0-9]*)
if [ "$num" -gt "$(echo "$rule_group" | awk -F "#" '{print NF}')" ]; then if [ "$num" -gt "$(echo "$rule_group" | awk -F "#" '{print NF}')" ]; then
errornum errornum
sleep 1
else else
rule_group_set=$(echo "$rule_group" | cut -d'#' -f"$num") rule_group_set=$(echo "$rule_group" | cut -d'#' -f"$num")
rule_all="- ${rule_type_set},${rule_state_set},${rule_group_set}" rule_all="- ${rule_type_set},${rule_state_set},${rule_group_set}"
echo "IP-CIDR SRC-IP-CIDR IP-CIDR6" | grep -q -- "$rule_type_set" && rule_all="${rule_all},no-resolve" echo "IP-CIDR SRC-IP-CIDR IP-CIDR6" | grep -q -- "$rule_type_set" && rule_all="${rule_all},no-resolve"
echo "$rule_all" >>"$YAMLSDIR"/rules.yaml echo "$rule_all" >>"$YAMLSDIR"/rules.yaml
echo "-----------------------------------------------" msg_alert "\033[32m添加成功\033[0m"
echo -e "\033[32m添加成功\033[0m"
fi fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
} }
del_rule_type() { del_rule_type() {
while true; do while true; do
echo -e "输入对应数字即可移除相应规则:" comp_box "输入对应数字即可移除相应规则"
sed -i '/^ *$/d; /^#/d' "$YAMLSDIR"/rules.yaml sed -i '/^ *$/d; /^#/d' "$YAMLSDIR"/rules.yaml
cat "$YAMLSDIR"/rules.yaml | grep -Ev '^#' | awk -F "#" '{print " "NR" "$1$2$3}' awk -F '#' '!/^#/ {print NR") "$1 $2 $3}' "$YAMLSDIR/rules.yaml" |
echo "-----------------------------------------------" while IFS= read -r line; do
echo -e " 0 返回上级菜单" content_line "$line"
read -p "请输入对应数字 > " num done
btm_box "" \
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
*) *)
if [ "$num" -le "$(wc -l <"$YAMLSDIR"/rules.yaml)" ]; then if [ "$num" -le "$(wc -l <"$YAMLSDIR"/rules.yaml)" ]; then
sed -i "${num}d" "$YAMLSDIR"/rules.yaml if sed -i "${num}d" "$YAMLSDIR"/rules.yaml; then
common_success
else
common_failed
fi
sleep 1 sleep 1
else else
errornum errornum
sleep 1
break
fi fi
;; ;;
esac esac
@@ -173,18 +170,18 @@ setrules() { # 自定义规则
} }
while true; do while true; do
echo "-----------------------------------------------" comp_box "\033[33m你可以在这里快捷管理自定义规则\033[0m" \
echo -e "\033[33m你可以在这里快捷管理自定义规则\033[0m" "如需批量操作,请手动编辑:\033[36m $YAMLSDIR/rules.yaml\033[0m" \
echo -e "如需批量操作,请手动编辑:\033[36m $YAMLSDIR/rules.yaml\033[0m" "\033[33msingbox和clash共用此处规则可无缝切换\033[0m" \
echo -e "\033[33msingbox和clash共用此处规则可无缝切换\033[0m" "大量规则请尽量使用rule-set功能添加\n\033[31m此处过量添加可能导致启动卡顿\033[0m"
echo -e "大量规则请尽量使用rule-set功能添加\033[31m此处过量添加可能导致启动卡顿\033[0m" content_line "1) 新增自定义规则"
echo "-----------------------------------------------" content_line "2) 移除自定义规则"
echo -e " 1 新增自定义规则" content_line "3) 清空规则列表"
echo -e " 2 移除自定义规则" echo "$crashcore" | grep -q 'singbox' || content_line "4) 配置节点绕过: \033[36m$proxies_bypass\033[0m"
echo -e " 3 清空规则列表" content_line ""
echo "$crashcore" | grep -q 'singbox' || echo -e " 4 配置节点绕过: \033[36m$proxies_bypass\033[0m" content_line "0) 返回上级菜单"
echo -e " 0 返回上级菜单" separator_line "="
read -p "请输入对应数字 > " num read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -195,56 +192,82 @@ setrules() { # 自定义规则
set_rule_type set_rule_type
;; ;;
2) 2)
echo "-----------------------------------------------"
if [ -s "$YAMLSDIR"/rules.yaml ]; then if [ -s "$YAMLSDIR"/rules.yaml ]; then
del_rule_type del_rule_type
else else
echo -e "请先添加自定义规则!" msg_alert "请先添加自定义规则!"
sleep 1
fi fi
;; ;;
3) 3)
read -p "确认清空全部自定义规则?(1/0) > " res comp_box "是否确认清空全部自定义规则?"
[ "$res" = "1" ] && sed -i '/^\s*[^#]/d' "$YAMLSDIR"/rules.yaml btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
if sed -i '/^\s*[^#]/d' "$YAMLSDIR"/rules.yaml; then
common_success
else
common_failed
fi
fi
;; ;;
4) 4)
echo "-----------------------------------------------"
if [ "$proxies_bypass" = "OFF" ]; then if [ "$proxies_bypass" = "OFF" ]; then
echo -e "\033[33m本功能会自动将当前配置文件中的节点域名或IP设置为直连规则以防止出现双重流量\033[0m" comp_box "\033[33m本功能会自动将当前配置文件中的节点域名或IP设置为直连规则以防止出现双重流量\033[0m" \
echo -e "\033[33m请确保下游设备使用的节点与ShellCrash中使用的节点相同否则无法生效\033[0m" "\033[33m请确保下游设备使用的节点与ShellCrash中使用的节点相同否则无法生效\033[0m" \
read -p "启用节点绕过?(1/0) > " res "" \
[ "$res" = "1" ] && proxies_bypass=ON "是否启用节点绕过?"
btm_box
"1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
proxies_bypass=ON
else
continue
fi
else else
proxies_bypass=OFF proxies_bypass=OFF
fi fi
setconfig proxies_bypass "$proxies_bypass"
sleep 1 if setconfig proxies_bypass "$proxies_bypass"; then
common_success
else
common_failed
fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
} }
setgroups() { # 自定义clash策略组 # 自定义clash策略组
setgroups() {
set_group_type() { set_group_type() {
echo "-----------------------------------------------" comp_box "\033[33m注意策略组名称必须和【自定义规则】或【自定义节点】功能中指定的策略组一致\033[0m" \
echo -e "\033[33m注意策略组名称必须和【自定义规则】或【自定义节点】功能中指定的策略组一致!\033[0m" "\033[33m建议先创建策略组,之后可在【自定义规则】或【自定义节点】功能中智能指定\033[0m" \
echo -e "\033[33m建议先创建策略组,之后可在【自定义规则】或【自定义节点】功能中智能指定\033[0m" "\033[33m如需在当前策略组下添加节点,请手动编辑$YAMLSDIR/proxy-groups.yaml\033[0m"
echo -e "\033[33m如需在当前策略组下添加节点请手动编辑$YAMLSDIR/proxy-groups.yaml\033[0m" btm_box "\033[36m请直接输入自定义策略组名称\033[0m\n不支持纯数字且不要包含特殊字符" \
read -r -p "输入自定义策略组名称(不支持纯数字且不要包含特殊字符!) > " new_group_name "输入 0 返回上级菜单"
read -r -p "请输入> " new_group_name
echo "-----------------------------------------------" comp_box "\033[32m请选择策略组【$new_group_name】的类型:\033[0m"
echo -e "\033[32m请选择策略组【$new_group_name】的类型!\033[0m" printf '%s\n' "$group_type_cn" |
echo "$group_type_cn" | awk '{for(i=1;i<=NF;i++){print i" "$i}}' awk '{for (i = 1; i <= NF; i++) print i") " $i}' |
read -r -p "请输入对应数字 > " num while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入对应数字> " num
new_group_type=$(echo "$group_type" | awk '{print $'"$num"'}') new_group_type=$(echo "$group_type" | awk '{print $'"$num"'}')
if [ "$num" = "1" ]; then if [ "$num" = "1" ]; then
unset new_group_url interval unset new_group_url interval
else else
read -r -p "请输入测速地址回车则默认使用https://www.gstatic.com/generate_204 > " new_group_url comp_box "请输入测速地址" \
"或直接回车使用默认地址https://www.gstatic.com/generate_204"
read -r -p "请输入> " new_group_url
[ -z "$new_group_url" ] && new_group_url=https://www.gstatic.com/generate_204 [ -z "$new_group_url" ] && new_group_url=https://www.gstatic.com/generate_204
new_group_url="url: '$new_group_url'" new_group_url="url: '$new_group_url'"
interval="interval: 300" interval="interval: 300"
@@ -260,20 +283,22 @@ setgroups() { # 自定义clash策略组
- DIRECT - DIRECT
EOF EOF
sed -i "/^ *$/d" "$YAMLSDIR"/proxy-groups.yaml sed -i "/^ *$/d" "$YAMLSDIR"/proxy-groups.yaml
echo "-----------------------------------------------" msg_alert "\033[32m添加成功\033[0m"
echo -e "\033[32m添加成功\033[0m"
} }
set_group_add() { set_group_add() {
echo "-----------------------------------------------" comp_box "\033[36m请选择想要将本策略添加到的策略组\033[0m" \
echo -e "\033[36m请选择想要将本策略添加到策略组\033[0m" "\033[32m如需添加到多个策略组,请一次性输入多个数字并用空格隔开\033[0m"
echo -e "\033[32m如需添加到多个策略组请一次性输入多个数字并用空格隔开\033[0m" printf '%s\n' "$proxy_group" |
echo "-----------------------------------------------" awk -F '#' '{for (i = 1; i <= NF; i++) print i") " $i}' |
echo "$proxy_group" | awk -F '#' '{for(i=1;i<=NF;i++){print i" "$i}}' while IFS= read -r line; do
echo "-----------------------------------------------" content_line "$line"
echo -e " 0 跳过添加" done
read -r -p "请输入对应数字(多个用空格隔开) > " char content_line ""
content_line "0) 跳过添加"
separator_line "="
read -r -p "请输入对应数字(多个用空格分隔)> " char
case "$char" in case "$char" in
"" | 0) ;; "" | 0) ;;
*) *)
@@ -286,22 +311,20 @@ EOF
unset rule_group_add unset rule_group_add
else else
errornum errornum
sleep 1
fi fi
;; ;;
esac esac
} }
while true; do while true; do
echo "-----------------------------------------------" comp_box "\033[33m你可以在这里快捷管理自定义策略组\033[0m" \
echo -e "\033[33m你可以在这里快捷管理自定义策略组\033[0m" "\033[36m如需修改或批量操作请手动编辑$YAMLSDIR/proxy-groups.yaml\033[0m"
echo -e "\033[36m如需修改或批量操作请手动编辑$YAMLSDIR/proxy-groups.yaml\033[0m" btm_box "1) 添加自定义策略组" \
echo "-----------------------------------------------" "2) 查看自定义策略组" \
echo -e " 1 添加自定义策略组" "3) 清空自定义策略组" \
echo -e " 2 查看自定义策略组" "" \
echo -e " 3 清空自定义策略组" "0) 返回上级菜单"
echo -e " 0 返回上级菜单" read -r -p "请输入对应数字> " num
read -r -p "请输入对应数字 > " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -313,48 +336,67 @@ EOF
set_group_type set_group_type
;; ;;
2) 2)
echo "-----------------------------------------------" line_break
echo "==========================================================="
cat "$YAMLSDIR"/proxy-groups.yaml cat "$YAMLSDIR"/proxy-groups.yaml
echo ""
echo "==========================================================="
;; ;;
3) 3)
read -p "确认清空全部自定义策略组?(1/0) > " res comp_box "是否确认清空全部自定义策略组?"
[ "$res" = "1" ] && echo '#用于添加自定义策略组' >"$YAMLSDIR"/proxy-groups.yaml btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
if echo '#用于添加自定义策略组' >"$YAMLSDIR"/proxy-groups.yaml; then
common_success
else
common_failed
fi
fi
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
} }
setproxies() { # 自定义clash节点 # 自定义clash节点
setproxies() {
set_proxy_type() { set_proxy_type() {
echo "-----------------------------------------------" while true; do
echo -e "\033[33m注意节点格式必须是单行,不包括括号,name:必须写在最前,例如:\033[0m" comp_box "\033[33m注意\n节点格式必须是单行不包括括号、“name:”为开头,例如:\033[0m" \
echo -e "\033[36m【name: \"test\", server: 192.168.1.1, port: 12345, type: socks5, udp: true】\033[0m" "\033[36m【name: \"test\", server: 192.168.1.1, port: 12345, type: socks5, udp: true】\033[0m" \
echo -e "更多写法请参考:\033[32m https://juewuy.github.io/ \033[0m" "更多写法请参考:\033[32mhttps://juewuy.github.io/\033[0m"
read -r -p "请输入节点 > " proxy_state_set btm_box "\033[36m请直接输入自定义节点\033[0m" \
if echo "$proxy_state_set" | grep -q "#"; then "或输入 0 返回上级菜单"
echo -e "\033[33m绝对禁止包含【#】号!!!\033[0m" read -r -p "请输入> " proxy_state_set
if [ "$proxy_state_set" = 0 ]; then
break
elif echo "$proxy_state_set" | grep -q "#"; then
msg_alert "\033[33m绝对禁止包含【#】号!\033[0m"
elif echo "$proxy_state_set" | grep -Eq "^name:"; then elif echo "$proxy_state_set" | grep -Eq "^name:"; then
set_group_add set_group_add
else else
errornum errornum
sleep 1
fi fi
done
} }
set_group_add() { set_group_add() {
echo "-----------------------------------------------" comp_box "\033[36m请选择想要将节点添加到的策略组\033[0m" \
echo -e "\033[36m请选择想要将节点添加到策略组\033[0m" "\033[32m如需添加到多个策略组,请一次性输入多个数字并用空格隔开\033[0m" \
echo -e "\033[32m如需添加到多个策略组,请一次性输入多个数字并用空格隔开\033[0m" "\033[33m如需自定义策略组,请先使用【管理自定义策略组功能】添加\033[0m"
echo -e "\033[33m如需自定义策略组请先使用【管理自定义策略组功能】添加\033[0m" printf '%s\n' "$proxy_group" |
echo "-----------------------------------------------" awk -F '#' '{for (i = 1; i <= NF; i++) print i") " $i}' |
echo "$proxy_group" | awk -F '#' '{for(i=1;i<=NF;i++){print i" "$i}}' while IFS= read -r line; do
echo "-----------------------------------------------" content_line "$line"
echo -e " 0 返回上级菜单" done
read -r -p "请输入对应数字(多个用空格隔开) > " char btm_box "" \
"0) 返回上级菜单"
read -r -p "请输入对应数字(多个用空格分隔)> " char
case "$char" in case "$char" in
"" | 0) ;; "" | 0) ;;
*) *)
@@ -364,28 +406,25 @@ setproxies() { # 自定义clash节点
done done
if [ -n "$rule_group_add" ]; then if [ -n "$rule_group_add" ]; then
echo "- {$proxy_state_set}$rule_group_add" >>"$YAMLSDIR"/proxies.yaml echo "- {$proxy_state_set}$rule_group_add" >>"$YAMLSDIR"/proxies.yaml
echo "-----------------------------------------------" msg_alert "\033[32m添加成功\033[0m"
echo -e "\033[32m添加成功\033[0m"
unset rule_group_add unset rule_group_add
else else
errornum errornum
sleep 1
fi fi
;; ;;
esac esac
} }
while true; do while true; do
echo "-----------------------------------------------" comp_box "\033[33m你可以在这里快捷管理自定义节点\033[0m" \
echo -e "\033[33m你可以在这里快捷管理自定义节点\033[0m" "\033[36m如需批量操作请手动编辑$YAMLSDIR/proxies.yaml\033[0m"
echo -e "\033[36m如需批量操作请手动编辑$YAMLSDIR/proxies.yaml\033[0m" btm_box "1) 添加自定义节点" \
echo "-----------------------------------------------" "2) 管理自定义节点" \
echo -e " 1 添加自定义节点" "3) 清空自定义节点" \
echo -e " 2 管理自定义节点" "4) 配置节点绕过: \033[36m$proxies_bypass\033[0m" \
echo -e " 3 清空自定义节点" "" \
echo -e " 4 配置节点绕过: \033[36m$proxies_bypass\033[0m" "0) 返回上级菜单"
echo -e " 0 返回上级菜单" read -r -p "请输入对应数字> " num
read -r -p "请输入对应数字 > " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -396,35 +435,63 @@ setproxies() { # 自定义clash节点
set_proxy_type set_proxy_type
;; ;;
2) 2)
echo "-----------------------------------------------"
sed -i '/^ *$/d' "$YAMLSDIR"/proxies.yaml 2>/dev/null sed -i '/^ *$/d' "$YAMLSDIR"/proxies.yaml 2>/dev/null
if [ -s "$YAMLSDIR"/proxies.yaml ]; then if [ -s "$YAMLSDIR"/proxies.yaml ]; then
echo -e "当前已添加的自定义节点为:" comp_box "\033[33m输入节点对应数字可以移除对应节点\033[0m" \
cat "$YAMLSDIR"/proxies.yaml | grep -Ev '^#' | awk -F '[,,}]' '{print NR, $1, $NF}' | sed 's/- {//g' "当前已添加的自定义节点为:"
echo "-----------------------------------------------" grep -Ev '^#' "$YAMLSDIR/proxies.yaml" |
echo -e "\033[33m输入节点对应数字可以移除对应节点\033[0m" awk -F '[,}]' '{print NR") " $1 " " $NF}' |
read -r -p "请输入对应数字 > " num sed 's/- {//g' |
if [ "$num" -le $(cat "$YAMLSDIR"/proxies.yaml | grep -Ev '^#' | wc -l) ]; then while IFS= read -r line; do
sed -i "$num{/^\s*[^#]/d}" "$YAMLSDIR"/proxies.yaml content_line "$line"
done
btm_box "" \
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
if [ "$num" = 0 ]; then
continue
elif [ "$num" -le $(cat "$YAMLSDIR"/proxies.yaml | grep -Ev '^#' | wc -l) ]; then
if sed -i "$num{/^\s*[^#]/d}" "$YAMLSDIR"/proxies.yaml; then
common_success
else
common_failed
fi
else else
errornum errornum
fi fi
else else
echo -e "请先添加自定义节点!" msg_alert "请先添加自定义节点!"
sleep 1
fi fi
;; ;;
3) 3)
read -r -p "确认清空全部自定义节点?(1/0) > " res comp_box "是否确认清空全部自定义节点?"
[ "$res" = "1" ] && sed -i '/^\s*[^#]/d' "$YAMLSDIR"/proxies.yaml 2>/dev/null btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
if sed -i '/^\s*[^#]/d' "$YAMLSDIR"/proxies.yaml 2>/dev/null; then
common_success
else
common_failed
fi
else
continue
fi
;; ;;
4) 4)
echo "-----------------------------------------------"
if [ "$proxies_bypass" = "OFF" ]; then if [ "$proxies_bypass" = "OFF" ]; then
echo -e "\033[33m本功能会自动将当前配置文件中的节点域名或IP设置为直连规则以防止出现双重流量\033[0m" comp_box "\033[33m本功能会自动将当前配置文件中的节点域名或IP设置为直连规则以防止出现双重流量\033[0m" \
echo -e "\033[33m请确保下游设备使用的节点与ShellCrash中使用的节点相同否则无法生效\033[0m" "\033[33m请确保下游设备使用的节点与ShellCrash中使用的节点相同否则无法生效\033[0m" \
read -r -p "启用节点绕过?(1/0) > " res "" \
[ "$res" = "1" ] && proxies_bypass=ON "是否确定启用节点绕过:"
btm_box "1) 是" \
"0) 否,返回上级菜单"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
proxies_bypass=ON
else
continue
fi
else else
proxies_bypass=OFF proxies_bypass=OFF
fi fi
@@ -435,19 +502,19 @@ setproxies() { # 自定义clash节点
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
} }
set_clash_adv(){ #自定义clash高级规则 # 自定义clash高级规则
[ ! -f "$YAMLSDIR"/user.yaml ] && cat > "$YAMLSDIR"/user.yaml <<EOF set_clash_adv() {
[ ! -f "$YAMLSDIR"/user.yaml ] && cat >"$YAMLSDIR"/user.yaml <<EOF
#用于编写自定义设定(可参考https://lancellc.gitbook.io/clash/clash-config-file/general 或 https://docs.metacubex.one/function/general) #用于编写自定义设定(可参考https://lancellc.gitbook.io/clash/clash-config-file/general 或 https://docs.metacubex.one/function/general)
#端口之类请在脚本中修改,否则不会加载 #端口之类请在脚本中修改,否则不会加载
#port: 7890 #port: 7890
EOF EOF
[ ! -f "$YAMLSDIR"/others.yaml ] && cat > "$YAMLSDIR"/others.yaml <<EOF [ ! -f "$YAMLSDIR"/others.yaml ] && cat >"$YAMLSDIR"/others.yaml <<EOF
#用于编写自定义的锚点、入站、proxy-providers、sub-rules、rule-set、script等功能 #用于编写自定义的锚点、入站、proxy-providers、sub-rules、rule-set、script等功能
#可参考 https://github.com/MetaCubeX/Clash.Meta/blob/Meta/docs/config.yaml 或 https://lancellc.gitbook.io/clash/clash-config-file/an-example-configuration-file #可参考 https://github.com/MetaCubeX/Clash.Meta/blob/Meta/docs/config.yaml 或 https://lancellc.gitbook.io/clash/clash-config-file/an-example-configuration-file
#此处内容会被添加在配置文件的“proxy-group”模块的末尾与“rules”模块之前的位置 #此处内容会被添加在配置文件的“proxy-group”模块的末尾与“rules”模块之前的位置
@@ -459,25 +526,25 @@ EOF
#script: #script:
#listeners: #listeners:
EOF EOF
echo "-----------------------------------------------"
echo -e "\033[32m已经创建自定义设定文件$YAMLSDIR/user.yaml \033[0m" comp_box "\033[32m已经创建自定义设定文件$YAMLSDIR/user.yaml \033[0m" \
echo -e "\033[33m可用于编写自定义的DNS等功能\033[0m" "\033[33m可用于编写自定义的DNS等功能\033[0m" \
echo "-----------------------------------------------" "" \
echo -e "\033[32m已经创建自定义功能文件$YAMLSDIR/others.yaml \033[0m" "\033[32m已经创建自定义功能文件$YAMLSDIR/others.yaml \033[0m" \
echo -e "\033[33m可用于编写自定义的锚点、入站、proxy-providers、sub-rules、rule-set、script等功能\033[0m" "\033[33m可用于编写自定义的锚点、入站、proxy-providers、rule-set、sub-rules、script等功能\033[0m"
echo "-----------------------------------------------"
echo -e "Windows下请\n使用\033[33mWinSCP软件\033[0m进行编辑\033[0m" btm_box "Windows下请使用\033[33mWinSCP软件\033[0m进行编辑\033[0m" \
echo -e "MacOS下请\n使用\033[33mSecureFX软件\033[0m进行编辑\033[0m" "MacOS下请使用\033[33mSecureFX软件\033[0m进行编辑\033[0m" \
echo -e "Linux本机可\n使用\033[33mvim\033[0m进行编辑(路由设备可能不显示中文请勿使用)\033[0m" "Linux使用\033[33mvim\033[0m进行编辑路由设备不显示中文请勿使用\033[0m"
} }
set_singbox_adv(){ #自定义singbox配置文件 # s自定义singbox配置文件
echo "-----------------------------------------------" set_singbox_adv() {
echo -e "支持覆盖脚本设置的模块有:\033[0m" comp_box "支持覆盖脚本设置的模块有:\033[0m" \
echo -e "\033[36mlog dns ntp certificate experimental\033[0m" "\033[36mlog dns ntp certificate experimental\033[0m" \
echo -e "支持与内置功能合并(但不可冲突)的模块有:\033[0m" "支持与内置功能合并但不可冲突的模块有:\033[0m" \
echo -e "\033[36mendpoints inbounds outbounds providers route services\033[0m" "\033[36mendpoints inbounds outbounds providers route services\033[0m" \
echo -e "将相应json文件放入\033[33m$JSONSDIR\033[0m目录后即可在启动时自动加载" "将相应json文件放入\033[33m$JSONSDIR\033[0m目录后即可在启动时自动加载" \
echo "-----------------------------------------------" "" \
echo -e "使用前请务必参考配置教程:\033[32;4m https://juewuy.github.io/nWTjEpkSK \033[0m" "使用前请务必参考配置教程\033[32;4m https://juewuy.github.io/nWTjEpkSK \033[0m"
} }

View File

@@ -14,77 +14,89 @@ providers() {
while true; do while true; do
# 获取模版名称 # 获取模版名称
if [ -z "$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg)" ]; then if [ -z "$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg)" ]; then
provider_temp_des=$(sed -n "1 p" "$CRASHDIR"/configs/${CORE_TYPE}_providers.list | awk '{print $1}') provider_temp_des=$(sed -n "1 p" "$CRASHDIR"/configs/"${CORE_TYPE}"_providers.list | awk '{print $1}')
else else
provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}') provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
provider_temp_des=$(grep "$provider_temp_file" "$CRASHDIR"/configs/${CORE_TYPE}_providers.list | awk '{print $1}') provider_temp_des=$(grep "$provider_temp_file" "$CRASHDIR"/configs/"${CORE_TYPE}"_providers.list | awk '{print $1}')
[ -z "$provider_temp_des" ] && provider_temp_des=$provider_temp_file [ -z "$provider_temp_des" ] && provider_temp_des=$provider_temp_file
fi fi
separator_line "-"
content_line "1) \033[32m生成\033[0m包含全部提供者的配置文件" comp_box "1) \033[32m生成\033[0m包含全部提供者的配置文件" \
content_line "2) 选择\033[33m规则模版\033[0m \033[32m$provider_temp_des\033[0m" "2) 选择\033[33m规则模版\033[0m \033[32m$provider_temp_des\033[0m" \
content_line "3) \033[33m清理\033[0mproviders目录文件" "3) \033[33m清理\033[0mproviders目录文件" \
separator_line "-" "" \
common_back "0) $COMMON_BACK"
read -p "请输入对应字母或数字 > " num read -r -p "请输入对应字母或数字> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
1) 1)
separator_line "-"
if [ -s "$CRASHDIR"/configs/providers.cfg ] || [ -s "$CRASHDIR"/configs/providers_uri.cfg ]; then if [ -s "$CRASHDIR"/configs/providers.cfg ] || [ -s "$CRASHDIR"/configs/providers_uri.cfg ]; then
. "$CRASHDIR/menus/providers_$CORE_TYPE.sh" . "$CRASHDIR/menus/providers_$CORE_TYPE.sh"
gen_providers gen_providers
else else
content_line "\033[31m你还未添加链接或本地配置文件请先添加\033[0m" msg_alert "\033[31m你还未添加链接或本地配置文件请先添加\033[0m"
sleep 1
fi fi
;; ;;
2) 2)
list=$(cat "$CRASHDIR/configs/${CORE_TYPE}_providers.list" | awk '{print $1}') list=$(cat "$CRASHDIR/configs/${CORE_TYPE}_providers.list" | awk '{print $1}')
separator_line "-"
content_line "当前规则模版为:\033[32m$provider_temp_des\033[0m" comp_box "当前规则模版为:\033[32m$provider_temp_des\033[0m" \
content_line "\033[33m请选择在线模版\033[0m" "\033[33m请选择在线模版\033[0m"
separator_line "-"
list_box "$list" list_box "$list"
separator_line "-" btm_box "" \
content_line "a) 使用\033[36m本地模版\033[0m" "a) 使用\033[36m本地模版\033[0m" \
common_back "" \
read -p "请输入对应字母或数字 > " num "0) $COMMON_BACK"
read -r -p "请输入对应字母或数字> " num
case "$num" in case "$num" in
"" | 0) ;; "" | 0) ;;
a) a)
read -p "请输入模版的路径(绝对路径) > " dir line_break
if [ -s $dir ]; then read -r -p "请输入模版的路径(绝对路径)> " dir
if [ -s "$dir" ]; then
provider_temp_file=$dir provider_temp_file=$dir
setconfig provider_temp_"$CORE_TYPE" "$provider_temp_file" if setconfig provider_temp_"$CORE_TYPE" "$provider_temp_file"; then
content_line "\033[32m设置成功\033[0m" common_success
else else
content_line "\033[31m输入错误找不到对应模版文件\033[0m" common_failed
fi
else
msg_alert "\033[31m输入错误找不到对应模版文件\033[0m"
fi fi
sleep 1
;; ;;
*) *)
provider_temp_file=$(sed -n "$num p" "$CRASHDIR"/configs/${CORE_TYPE}_providers.list 2>/dev/null | awk '{print $2}') provider_temp_file=$(sed -n "$num p" "$CRASHDIR"/configs/"${CORE_TYPE}"_providers.list 2>/dev/null | awk '{print $2}')
if [ -z "$provider_temp_file" ]; then if [ -z "$provider_temp_file" ]; then
errornum errornum
sleep 1
else else
setconfig provider_temp_"$CORE_TYPE" "$provider_temp_file" if setconfig provider_temp_"$CORE_TYPE" "$provider_temp_file"; then
common_success
else
common_failed
fi
fi fi
;; ;;
esac esac
;; ;;
3) 3)
content_line "\033[33m将清空 $CRASHDIR/providers 目录下所有内容\033[0m" comp_box "\033[33m将清空 $CRASHDIR/providers 目录下所有内容\033[0m" \
read -p "是否继续?(1/0) > " res "" \
[ "$res" = "1" ] && rm -rf "$CRASHDIR"/providers && common_success "是否继续?"
btm_box "1) 是" \
"0) 否"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = "1" ]; then
if rm -rf "$CRASHDIR"/providers; then
common_success
else
common_failed
fi
fi
;; ;;
*) *)
errornum errornum
sleep 1
break
;; ;;
esac esac
done done

View File

@@ -6,65 +6,68 @@ __IS_PROVIDERS_CLASH=1
. "$CRASHDIR"/libs/web_get_bin.sh . "$CRASHDIR"/libs/web_get_bin.sh
#生成clash的providers配置文件 # 生成clash的providers配置文件
gen_providers(){ gen_providers() {
if [ -z "$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg)" ];then if [ -z "$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg)" ]; then
provider_temp_file="$(sed -n "1 p" "$CRASHDIR"/configs/${CORE_TYPE}_providers.list | awk '{print $2}')" provider_temp_file="$(sed -n "1 p" "$CRASHDIR"/configs/"${CORE_TYPE}"_providers.list | awk '{print $2}')"
else else
provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}') provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
fi fi
echo "-----------------------------------------------"
if [ -s "$provider_temp_file" ];then if [ -s "$provider_temp_file" ]; then
ln -sf "$provider_temp_file" "$TMPDIR"/provider_temp_file ln -sf "$provider_temp_file" "$TMPDIR"/provider_temp_file
else else
echo -e "\033[33m正在获取在线模版\033[0m" msg_alert "\033[33m正在获取在线模版......\033[0m"
get_bin "$TMPDIR"/provider_temp_file "rules/${CORE_TYPE}_providers/$provider_temp_file" get_bin "$TMPDIR"/provider_temp_file "rules/${CORE_TYPE}_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" msg_alert "\033[31m下载失败请尝试更换安装源\033[0m"
. "$CRASHDIR"/menus/9_upgrade.sh && setserver . "$CRASHDIR"/menus/9_upgrade.sh && setserver
setproviders setproviders
} }
fi fi
#生成proxy_providers模块 # 生成proxy_providers模块
mkdir -p "$TMPDIR"/providers mkdir -p "$TMPDIR"/providers
#预创建文件并写入对应文件头 # 预创建文件并写入对应文件头
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 "$1" ];then if [ -n "$1" ]; then
gen_providers_txt $@ gen_providers_txt "$@"
providers_tags=$1 providers_tags=$1
else else
#基于全部订阅/本地文件生成 # 基于全部订阅/本地文件生成
[ -s "$CRASHDIR"/configs/providers.cfg ] && { [ -s "$CRASHDIR"/configs/providers.cfg ] && {
providers_tags='' providers_tags=''
while read line;do while read -r line; do
gen_providers_txt $line gen_providers_txt $line
providers_tags=$(echo "$providers_tags, $tag" | sed 's/^, //') providers_tags=$(echo "$providers_tags, $tag" | sed 's/^, //')
done < "$CRASHDIR"/configs/providers.cfg done <"$CRASHDIR"/configs/providers.cfg
} }
#基于全部节点分享链接生成 # 基于全部节点分享链接生成
[ -s "$CRASHDIR"/configs/providers_uri.cfg ] && { [ -s "$CRASHDIR"/configs/providers_uri.cfg ] && {
mkdir -p "$CRASHDIR"/providers mkdir -p "$CRASHDIR"/providers
awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }' "$CRASHDIR"/configs/providers_uri.cfg > "$CRASHDIR"/providers/uri_group awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }' "$CRASHDIR"/configs/providers_uri.cfg >"$CRASHDIR"/providers/uri_group
gen_providers_txt "Uri_group" "./providers/uri_group" "3" "12" gen_providers_txt "Uri_group" "./providers/uri_group" "3" "12"
providers_tags=$(echo "$providers_tags, Uri_group" | sed 's/^, //') providers_tags=$(echo "$providers_tags, Uri_group" | sed 's/^, //')
} }
fi fi
#修饰模版文件并合并 # 修饰模版文件并合并
sed -i "s/{providers_tags}/$providers_tags/g" "$TMPDIR"/providers/proxy-groups.yaml sed -i "s/{providers_tags}/$providers_tags/g" "$TMPDIR"/providers/proxy-groups.yaml
cut -c 1- "$TMPDIR"/providers/providers.yaml "$TMPDIR"/providers/proxy-groups.yaml "$TMPDIR"/providers/rules.yaml > "$TMPDIR"/config.yaml cut -c 1- "$TMPDIR"/providers/providers.yaml "$TMPDIR"/providers/proxy-groups.yaml "$TMPDIR"/providers/rules.yaml >"$TMPDIR"/config.yaml
rm -rf "$TMPDIR"/providers rm -rf "$TMPDIR"/providers
#调用内核测试 # 调用内核测试
. "$CRASHDIR"/starts/check_core.sh && check_core && "$TMPDIR"/CrashCore -t -d "$BINDIR" -f "$TMPDIR"/config.yaml . "$CRASHDIR"/starts/check_core.sh && check_core && "$TMPDIR"/CrashCore -t -d "$BINDIR" -f "$TMPDIR"/config.yaml
if [ "$?" = 0 ];then if [ "$?" = 0 ]; then
echo -e "\033[32m配置文件生成成功\033[0m" msg_alert "\033[32m配置文件生成成功\033[0m"
mkdir -p "$CRASHDIR"/yamls mkdir -p "$CRASHDIR"/yamls
mv -f "$TMPDIR"/config.yaml "$CRASHDIR"/yamls/config.yaml mv -f "$TMPDIR"/config.yaml "$CRASHDIR"/yamls/config.yaml
read -p "是否立即启动/重启服务?(1/0) > " res comp_box "是否立即启动/重启服务?"
btm_box "1) 是" \
"0) 否"
read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
start_core && . "$CRASHDIR"/libs/set_cron.sh && cronset '更新订阅' start_core && . "$CRASHDIR"/libs/set_cron.sh && cronset '更新订阅'
exit exit
@@ -72,12 +75,12 @@ gen_providers(){
else else
rm -rf "$TMPDIR"/CrashCore rm -rf "$TMPDIR"/CrashCore
rm -rf "$TMPDIR"/config.yaml rm -rf "$TMPDIR"/config.yaml
echo -e "\033[31m生成配置文件出错请仔细检查输入\033[0m" msg_alert "\033[31m生成配置文件出错请仔细检查输入\033[0m"
fi fi
} }
gen_providers_txt(){ gen_providers_txt() {
if [ -n "$(echo $2|grep -E '^./')" ];then if [ -n "$(echo "$2" | grep -E '^./')" ]; then
type=file type=file
path=$2 path=$2
download_url= download_url=
@@ -93,7 +96,7 @@ gen_providers_txt(){
exclude=${6#\#} exclude=${6#\#}
include=${7#\#} include=${7#\#}
cat >> "$TMPDIR"/providers/providers.yaml <<EOF cat >>"$TMPDIR"/providers/providers.yaml <<EOF
${1}: ${1}:
type: $type type: $type
url: "$download_url" url: "$download_url"
@@ -107,7 +110,7 @@ gen_providers_txt(){
EOF EOF
[ "$crashcore" = 'meta' ] && { [ "$crashcore" = 'meta' ] && {
[ "$skip_cert" != "OFF" ] && skip_cert_verify='skip-cert-verify: true' [ "$skip_cert" != "OFF" ] && skip_cert_verify='skip-cert-verify: true'
cat >> "$TMPDIR"/providers/providers.yaml <<EOF cat >>"$TMPDIR"/providers/providers.yaml <<EOF
header: header:
User-Agent: ["$ua"] User-Agent: ["$ua"]
override: override:
@@ -117,7 +120,6 @@ EOF
exclude-filter: "$exclude" exclude-filter: "$exclude"
EOF EOF
} }
#写入提供者 # 写入提供者
echo ' - {name: '"$tag"', type: url-test, tolerance: 100, lazy: true, use: ['"$tag"']}' >> "$TMPDIR"/providers/proxy-groups.yaml echo ' - {name: '"$tag"', type: url-test, tolerance: 100, lazy: true, use: ['"$tag"']}' >>"$TMPDIR"/providers/proxy-groups.yaml
} }

View File

@@ -6,83 +6,85 @@ __IS_PROVIDERS_SINGBOX=1
. "$CRASHDIR"/libs/web_get_bin.sh . "$CRASHDIR"/libs/web_get_bin.sh
#生成singbox的providers配置文件 # 生成singbox的providers配置文件
gen_providers(){ gen_providers() {
if [ -z "$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg)" ];then if [ -z "$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg)" ]; then
provider_temp_file="$(sed -n "1 p" "$CRASHDIR"/configs/${CORE_TYPE}_providers.list | awk '{print $2}')" provider_temp_file="$(sed -n "1 p" "$CRASHDIR"/configs/"${CORE_TYPE}"_providers.list | awk '{print $2}')"
else else
provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}') provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
fi fi
echo "-----------------------------------------------" if [ -s "$provider_temp_file" ]; then
if [ -s "$provider_temp_file" ];then
ln -sf "$provider_temp_file" "$TMPDIR"/provider_temp_file ln -sf "$provider_temp_file" "$TMPDIR"/provider_temp_file
else else
echo -e "\033[33m正在获取在线模版\033[0m" msg_alert "\033[33m正在获取在线模版......\033[0m"
get_bin "$TMPDIR"/provider_temp_file "rules/${CORE_TYPE}_providers/$provider_temp_file" get_bin "$TMPDIR"/provider_temp_file "rules/${CORE_TYPE}_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" msg_alert "\033[31m下载失败请尝试更换安装源\033[0m"
. "$CRASHDIR"/menus/9_upgrade.sh && setserver . "$CRASHDIR"/menus/9_upgrade.sh && setserver
setproviders setproviders
} }
fi fi
#生成outbound_providers模块 # 生成outbound_providers模块
mkdir -p "$TMPDIR"/providers mkdir -p "$TMPDIR"/providers
#预创建文件并写入对应文件头 # 预创建文件并写入对应文件头
cat > "$TMPDIR"/providers/providers.json <<EOF cat >"$TMPDIR"/providers/providers.json <<EOF
{ {
"providers": [ "providers": [
EOF EOF
cat > "$TMPDIR"/providers/outbounds_add.json <<EOF cat >"$TMPDIR"/providers/outbounds_add.json <<EOF
{ {
"outbounds": [ "outbounds": [
EOF EOF
#基于单订阅生成providers模块 # 基于单订阅生成providers模块
if [ -n "$1" ];then if [ -n "$1" ]; then
gen_providers_txt $@ gen_providers_txt "$@"
providers_tags=\"$1\" providers_tags=\"$1\"
else else
#基于全部订阅/本地文件生成 # 基于全部订阅/本地文件生成
[ -s "$CRASHDIR"/configs/providers.cfg ] && { [ -s "$CRASHDIR"/configs/providers.cfg ] && {
providers_tags='' providers_tags=''
while read line;do while read -r line; do
gen_providers_txt $line gen_providers_txt $line
providers_tags=$(echo "$providers_tags, \"$tag\"" | sed 's/^, //') providers_tags=$(echo "$providers_tags, \"$tag\"" | sed 's/^, //')
done < "$CRASHDIR"/configs/providers.cfg done <"$CRASHDIR"/configs/providers.cfg
} }
#基于全部节点分享链接生成 # 基于全部节点分享链接生成
[ -s "$CRASHDIR"/configs/providers_uri.cfg ] && { [ -s "$CRASHDIR"/configs/providers_uri.cfg ] && {
mkdir -p "$CRASHDIR"/providers mkdir -p "$CRASHDIR"/providers
awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }' "$CRASHDIR"/configs/providers_uri.cfg > "$CRASHDIR"/providers/uri_group awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }' "$CRASHDIR"/configs/providers_uri.cfg >"$CRASHDIR"/providers/uri_group
gen_providers_txt "Uri_group" "./providers/uri_group" "3" "12" gen_providers_txt "Uri_group" "./providers/uri_group" "3" "12"
providers_tags=$(echo "$providers_tags, \"Uri_group\"" | sed 's/^, //') providers_tags=$(echo "$providers_tags, \"Uri_group\"" | sed 's/^, //')
} }
fi fi
#修复文件格式 # 修复文件格式
sed -i '$s/},/}]}/' "$TMPDIR"/providers/outbounds_add.json sed -i '$s/},/}]}/' "$TMPDIR"/providers/outbounds_add.json
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" | sed "s/\"providers_tags\"/$providers_tags/g" > "$TMPDIR"/providers/outbounds.json cat "$TMPDIR"/provider_temp_file | sed "s/{providers_tags}/$providers_tags/g" | sed "s/\"providers_tags\"/$providers_tags/g" >"$TMPDIR"/providers/outbounds.json
rm -rf "$TMPDIR"/provider_temp_file rm -rf "$TMPDIR"/provider_temp_file
#调用内核测试 # 调用内核测试
. "$CRASHDIR"/starts/check_core.sh && check_core && "$TMPDIR"/CrashCore merge "$TMPDIR"/config.json -C "$TMPDIR"/providers . "$CRASHDIR"/starts/check_core.sh && check_core && "$TMPDIR"/CrashCore merge "$TMPDIR"/config.json -C "$TMPDIR"/providers
if [ "$?" = 0 ];then if [ "$?" = 0 ]; then
echo -e "\033[32m配置文件生成成功如果启动超时建议更新里手动安装Singbox-srs数据库常用包\033[0m" msg_alert "\033[32m配置文件生成成功如果启动超时建议更新里手动安装Singbox-srs数据库常用包\033[0m"
mkdir -p "$CRASHDIR"/jsons mkdir -p "$CRASHDIR"/jsons
mv -f "$TMPDIR"/config.json "$CRASHDIR"/jsons/config.json mv -f "$TMPDIR"/config.json "$CRASHDIR"/jsons/config.json
rm -rf "$TMPDIR"/providers rm -rf "$TMPDIR"/providerss
read -p "是否立即启动/重启服务?(1/0) > " res comp_box "是否立即启动/重启服务?"
btm_box "1) 是" \
"0) 否"
read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
start_core && . "$CRASHDIR"/libs/set_cron.sh && cronset '更新订阅' start_core && . "$CRASHDIR"/libs/set_cron.sh && cronset '更新订阅'
exit exit
} }
else else
echo -e "\033[31m生成配置文件出错请仔细检查输入\033[0m"
rm -rf "$TMPDIR"/CrashCore rm -rf "$TMPDIR"/CrashCore
#rm -rf "$TMPDIR"/providers msg_alert "\033[31m生成配置文件出错请仔细检查输入\033[0m"
# rm -rf "$TMPDIR"/providers
fi fi
} }
gen_providers_txt(){ gen_providers_txt() {
tag=$1 tag=$1
interval=${3:-3} interval=${3:-3}
interval2=${4:-12} interval2=${4:-12}
@@ -91,15 +93,15 @@ gen_providers_txt(){
include=${7#\#} include=${7#\#}
[ -n "$exclude" ] && exclude_ele="\"exclude\": \"$exclude\"," [ -n "$exclude" ] && exclude_ele="\"exclude\": \"$exclude\","
[ -n "$include" ] && include_ele="\"include\": \"$include\"," [ -n "$include" ] && include_ele="\"include\": \"$include\","
if [ -n "$(echo $2|grep -E '^./')" ];then if [ -n "$(echo "$2" | grep -E '^./')" ]; then
cat >> "$TMPDIR"/providers/providers.json <<EOF cat >>"$TMPDIR"/providers/providers.json <<EOF
{ {
"tag": "$tag", "tag": "$tag",
"type": "local", "type": "local",
"path": "$2", "path": "$2",
EOF EOF
else else
cat >> "$TMPDIR"/providers/providers.json <<EOF cat >>"$TMPDIR"/providers/providers.json <<EOF
{ {
"tag": "$tag", "tag": "$tag",
"type": "remote", "type": "remote",
@@ -111,9 +113,9 @@ EOF
$include_ele $include_ele
EOF EOF
fi fi
#通用部分生成 # 通用部分生成
[ "$skip_cert" != "OFF" ] && override_tls='true' || override_tls='false' [ "$skip_cert" != "OFF" ] && override_tls='true' || override_tls='false'
cat >> "$TMPDIR"/providers/providers.json <<EOF cat >>"$TMPDIR"/providers/providers.json <<EOF
"health_check": { "health_check": {
"enabled": true, "enabled": true,
"url": "https://www.gstatic.com/generate_204", "url": "https://www.gstatic.com/generate_204",
@@ -126,6 +128,6 @@ EOF
} }
}, },
EOF EOF
#写入提供者 # 写入提供者
echo '{ "tag": "'"$tag"'", "type": "urltest", "tolerance": 100, "providers": ["'"$tag"'"], "include": ".*" },' >> "$TMPDIR"/providers/outbounds_add.json echo '{ "tag": "'"$tag"'", "type": "urltest", "tolerance": 100, "providers": ["'"$tag"'"], "include": ".*" },' >>"$TMPDIR"/providers/outbounds_add.json
} }

View File

@@ -1,33 +1,37 @@
#!/bin/sh #!/bin/sh
# Copyright (C) Juewuy # Copyright (C) Juewuy
#. /tmp/SC_tmp/libs/check_dir_avail.sh [ -f /tmp/SC_tmp/libs/check_dir_avail.sh ] && . /tmp/SC_tmp/libs/check_dir_avail.sh
cecho() {
printf '%b\n' "$*"
}
set_usb_dir() { set_usb_dir() {
while true; do while true; do
cecho "请选择安装目录" comp_box "请选择安装目录"
du -hL /mnt | awk '{print " "NR" "$2" "$1}' du -hL /mnt |
read -p "请输入相应数字 > " num awk '{print NR") "$2 " " $1}' |
while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入相应数字> " num
dir=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p) dir=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p)
if [ -z "$dir" ]; then if [ -z "$dir" ]; then
cecho "\033[31m输入错误请重新设置\033[0m" msg_alert "\033[31m输入错误请重新设置\033[0m"
continue continue
fi fi
break 1 break 1
done done
} }
set_xiaomi_dir() { set_xiaomi_dir() {
cecho "\033[33m检测到当前设备为小米官方系统请选择安装位置\033[0m" comp_box "\033[33m检测到当前设备为小米官方系统请选择安装位置\033[0m"
[ -d /data ] && cecho " 1 安装到 /data 目录,剩余空间:$(dir_avail /data -h)(支持软固化功能)" [ -d /data ] && content_line "1) /data目录剩余空间:$(dir_avail /data -h) 支持软固化功能"
[ -d /userdisk ] && cecho " 2 安装到 /userdisk 目录,剩余空间:$(dir_avail /userdisk -h)(支持软固化功能)" [ -d /userdisk ] && content_line "2) /userdisk目录剩余空间:$(dir_avail /userdisk -h) 支持软固化功能"
[ -d /data/other_vol ] && cecho " 3 安装到 /data/other_vol 目录,剩余空间:$(dir_avail /data/other_vol -h)(支持软固化功能)" [ -d /data/other_vol ] && content_line "3) /data/other_vol目录剩余空间:$(dir_avail /data/other_vol -h) 支持软固化功能"
cecho " 4 安装到自定义目录(不推荐,不明勿用!)" content_line "4) 自定义目录不推荐,不明勿用!"
cecho " 0 退出安装" content_line ""
echo "-----------------------------------------------" content_line "0) 退出安装"
read -p "请输入相应数字 > " num separator_line "="
read -r -p "请输入相应数字> " num
case "$num" in case "$num" in
1) 1)
dir=/data dir=/data
@@ -42,56 +46,70 @@ set_xiaomi_dir() {
set_cust_dir set_cust_dir
;; ;;
*) *)
line_break
exit 1 exit 1
;; ;;
esac esac
} }
set_asus_usb() { set_asus_usb() {
while true; do while true; do
echo -e "请选择U盘目录" comp_box "请选择U盘目录"
du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print " "NR" "$2" "$1}' du -hL /tmp/mnt |
read -p "请输入相应数字 > " num awk -F/ 'NF<=4 {print NR") "$2 " " $1}' |
while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入相应数字> " num
dir=$(du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print $2}' | sed -n "$num"p) dir=$(du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print $2}' | sed -n "$num"p)
if [ ! -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ]; then if [ ! -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ]; then
echo -e "\033[31m未找到下载大师自启文件$dir/asusware.arm/etc/init.d/S50downloadmaster请检查设置\033[0m" msg_alert "\033[31m未找到下载大师自启文件$dir/asusware.arm/etc/init.d/S50downloadmaster请检查设置\033[0m"
sleep 1
else else
break break
fi fi
done done
} }
set_asus_dir() { set_asus_dir() {
cecho "\033[33m检测到当前设备为华硕固件请选择安装方式\033[0m" separator_line "="
cecho " 1 基于U盘+下载大师安装(支持所有固件限ARM设备须插入U盘或移动硬盘)" btm_box "\033[33m检测到当前设备为华硕固件请选择安装方式\033[0m" \
cecho " 2 基于自启脚本安装(仅支持部分梅林固件)" "1) 基于U盘+下载大师安装支持所有固件限ARM设备须插入U盘或移动硬盘" \
cecho " 0 退出安装" "2) 基于自启脚本安装(仅持部分梅林固件)" \
echo "-----------------------------------------------" "" \
read -p "请输入相应数字 > " num "0) 退出安装"
read -r -p "请输入相应数字> " num
case "$num" in case "$num" in
1) 1)
echo -e "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!" msg_alert -t 2 "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!"
sleep 2
set_asus_usb set_asus_usb
;; ;;
2) 2)
cecho "如开机无法正常自启请重新使用U盘+下载大师安装!" msg_alert -t 2 "如开机无法正常自启请重新使用U盘+下载大师安装!"
sleep 2
dir=/jffs dir=/jffs
;; ;;
*) *)
line_break
exit 1 exit 1
;; ;;
esac esac
} }
set_cust_dir() { set_cust_dir() {
while true; do while true; do
echo "-----------------------------------------------" comp_box "路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!" \
echo '可用路径 剩余空间:' "" \
df -h | awk '{print $6,$4}' | sed 1d "可用路径 剩余空间:"
echo '路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!!!' df -h |
read -p "请输入自定义路径 > " dir awk '{print $6, $4}' |
sed '1d' |
while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入自定义路径> " dir
if [ "$(dir_avail "$dir")" = 0 ] || [ -n "$(echo "$dir" | grep -Eq '^/(tmp|opt|sys)(/|$)')" ]; then if [ "$(dir_avail "$dir")" = 0 ] || [ -n "$(echo "$dir" | grep -Eq '^/(tmp|opt|sys)(/|$)')" ]; then
cecho "\033[31m路径错误请重新设置\033[0m" msg_alert "\033[31m路径错误请重新设置\033[0m"
continue continue
fi fi
break 1 break 1
@@ -100,22 +118,30 @@ set_cust_dir() {
set_crashdir() { set_crashdir() {
while true; do while true; do
echo "-----------------------------------------------" top_box "\033[33m注意安装ShellCrash至少需要预留约1MB的磁盘空间\033[0m"
cecho "\033[33m注意安装ShellCrash至少需要预留约1MB的磁盘空间\033[0m"
case "$systype" in case "$systype" in
Padavan) dir=/etc/storage ;; Padavan)
mi_snapshot) set_xiaomi_dir ;; dir=/etc/storage
asusrouter) set_asus_dir ;; ;;
ng_snapshot) dir=/tmp/mnt ;; mi_snapshot)
set_xiaomi_dir
;;
asusrouter)
set_asus_dir
;;
ng_snapshot)
dir=/tmp/mnt
;;
*) *)
cecho " 1 在\033[32m/etc目录\033[0m下安装(适合root用户)" separator_line "="
cecho " 2 在\033[32m/usr/share目录\033[0m下安装(适合Linux系统)" btm_box "1) 在\033[32m/etc目录\033[0m下安装适合root用户" \
cecho " 3 在\033[32m当前用户目录\033[0m下安装(适合非root用户)" "2) 在\033[32m/usr/share目录\033[0m下安装适合Linux系统" \
cecho " 4 在\033[32m外置存储\033[0m安装" "3) 在\033[32m当前用户目录\033[0m安装适合非root用户" \
cecho " 5 手动设置安装目录" "4) 在\033[32m外置存储\033[0m中安装" \
cecho " 0 退出安装" "5) 手动设置安装目录" \
echo "----------------------------------------------" "" \
read -p "请输入相应数字 > " num "0) 退出安装"
read -r -p "请输入相应数字> " num
# 设置目录 # 设置目录
case "$num" in case "$num" in
1) 1)
@@ -135,7 +161,8 @@ set_crashdir() {
set_cust_dir set_cust_dir
;; ;;
*) *)
echo "安装已取消" msg_alert "安装已取消"
line_break
exit 1 exit 1
;; ;;
esac esac
@@ -143,11 +170,14 @@ set_crashdir() {
esac esac
if [ ! -w "$dir" ]; then if [ ! -w "$dir" ]; then
cecho "\033[31m没有$dir目录写入权限!请重新设置!\033[0m" msg_alert "\033[31m没有$dir目录写入权限!请重新设置!\033[0m"
sleep 1
else else
cecho "目标目录\033[32m$dir\033[0m空间剩余$(dir_avail "$dir" -h)" comp_box "目标目录\033[32m$dir\033[0m空间剩余$(dir_avail "$dir" -h)" \
read -p "确认安装?(1/0) > " res "" \
"是否确认安装?"
btm_box "1) 是" \
"0) 否"
read -r -p "请输入相应数字> " res
if [ "$res" = "1" ]; then if [ "$res" = "1" ]; then
CRASHDIR="$dir"/ShellCrash CRASHDIR="$dir"/ShellCrash
break break

View File

@@ -7,26 +7,26 @@ __IS_MODULE_SUBCONVERTER=1
[ -z "$rule_link" ] && rule_link=1 [ -z "$rule_link" ] && rule_link=1
[ -z "$server_link" ] && server_link=1 [ -z "$server_link" ] && server_link=1
#Subconverter在线订阅转换 # Subconverter在线订阅转换
subconverter() { subconverter() {
while true; do while true; do
separator_line "-" comp_box "1) \033[32m生成\033[0m包含全部节点、订阅的配置文件"\
content_line "1) \033[32m生成\033[0m包含全部节点/订阅的配置文件" "2) 设置\033[31m排除节点正则\033[0m \033[47;30m$exclude\033[0m"\
content_line "2) 设置\033[31m排除节点正则\033[0m \033[47;30m$exclude\033[0m" "3) 设置\033[32m包含节点正则\033[0m \033[47;30m$include\033[0m"\
content_line "3) 设置\033[32m包含节点正则\033[0m \033[47;30m$include\033[0m" "4) 选择\033[33m在线规则模版\033[0m"\
content_line "4) 选择\033[33m在线规则模版\033[0m" "5) 选择\033[0mSubconverter服务器\033[0m"\
content_line "5) 选择\033[0mSubconverter服务器\033[0m" "6) 自定义浏览器UA \033[32m$user_agent\033[0m"\
content_line "6) 自定义浏览器UA \033[32m$user_agent\033[0m" ""\
common_back "0) $COMMON_BACK"
read -r -p "请输入对应数字 > " num read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
1) 1)
providers_link=$(grep -v '\./providers/' "$CRASHDIR"/configs/providers.cfg 2>/dev/null |awk '{print $2}' |paste -sd '|') providers_link=$(grep -v '\./providers/' "$CRASHDIR"/configs/providers.cfg 2>/dev/null | awk '{print $2}' | tr '\n' '|')
uri_link=$(grep -v '^#' "$CRASHDIR"/configs/providers_uri.cfg 2>/dev/null |awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }' |paste -sd '|') uri_link=$(grep -v '^#' "$CRASHDIR"/configs/providers_uri.cfg 2>/dev/null | awk '{ print ($1=="vmess" ? $2 : $2 "#" $1) }' | tr '\n' '|')
Url=$(echo "$providers_link|$uri_link" |sed 's/^|// ; s/|$//') Url=$(echo "$providers_link|$uri_link" | sed 's/||*/|/g; s/^|//; s/|$//')
setconfig Url "'$Url'" setconfig Url "'$Url'"
Https='' Https=''
setconfig Https setconfig Https
@@ -50,114 +50,136 @@ subconverter() {
;; ;;
*) *)
errornum errornum
break
;; ;;
esac esac
done done
} }
gen_link_flt() { # 排除节点正则 # 排除节点正则
[ -z "$exclude" ] && exclude="未设置" gen_link_flt() {
separator_line "-" comp_box "\033[33m匹配关键字的节点会在导入时被【屏蔽】\033[0m" \
content_line "\033[33m当前过滤关键字\033[47;30m$exclude\033[0m" "多个关键字可以用\033[30;47m | \033[0m号分隔" \
separator_line "-" "\033[32m支持正则表达式\033[0m空格请使用\033[30;47m + \033[0m号替代"
content_line "\033[33m匹配关键字的节点会在导入时被【屏蔽】\033[0m" btm_box "\033[36m请直接输入节点过滤关键字\033[0m" \
content_line "多个关键字可以用\033[30;47m | \033[0m号分隔" "或输入 d \033[31m清空\033[0m节点过滤关键字" \
content_line "\033[32m支持正则表达式\033[0m空格请使用\033[30;47m + \033[0m号替代" "或输入 0 返回上级菜单"
separator_line "-" read -r -p "请输入> " res
content_line " 000 \033[31m删除\033[0m关键字" case "$res" in
content_line " 回车 取消输入并返回上级菜单" 0)
separator_line "-" return 0
read -r -p "请输入关键字 > " exclude ;;
if [ "$exclude" = '000' ]; then d)
separator_line "-"
exclude='' exclude=''
content_line "\033[31m 已删除节点过滤关键字!!!\033[0m" ;;
*)
exclude="$res"
;;
esac
if setconfig exclude "'$exclude'"; then
common_success
else
common_failed
fi fi
setconfig exclude "'$exclude'"
} }
gen_link_ele() { # 包含节点正则 # 包含节点正则
[ -z "$include" ] && include="未设置" gen_link_ele() {
separator_line "-" comp_box "\033[33m仅有匹配关键字的节点才会被【导入】\033[0m" \
content_line "\033[33m当前筛选关键字\033[47;30m$include\033[0m" "多个关键字可以用\033[30;47m | \033[0m号分隔" \
separator_line "-" "\033[32m支持正则表达式\033[0m空格请使用\033[30;47m + \033[0m号替代"
content_line "\033[33m仅有匹配关键字的节点才会被【导入】\033[0m" btm_box "\033[36m请直接输入节点匹配关键字\033[0m" \
content_line "多个关键字可以用\033[30;47m | \033[0m号分隔" "或输入 d \033[31m清空\033[0m节点匹配关键字" \
content_line "\033[32m支持正则表达式\033[0m空格请使用\033[30;47m + \033[0m号替代" "或输入 0 返回上级菜单"
separator_line "-" read -r -p "请输入> " res
content_line " 000 \033[31m删除\033[0m关键字" case "$res" in
content_line " 回车 取消输入并返回上级菜单" 0)
separator_line "-" return 0
read -r -p "请输入关键字 > " include ;;
if [ "$include" = '000' ]; then d)
separator_line "-" include=""
include='' ;;
content_line "\033[31m 已删除节点匹配关键字!!!\033[0m" *)
include="$res"
;;
esac
if setconfig include "'$include'"; then
common_success
else
common_failed
fi fi
setconfig include "'$include'"
} }
gen_link_config() { #选择在线规则模版 # 选择在线规则模版
gen_link_config() {
list=$(grep -aE '^5' "$CRASHDIR"/configs/servers.list | awk '{print $2$4}') list=$(grep -aE '^5' "$CRASHDIR"/configs/servers.list | awk '{print $2$4}')
now=$(grep -aE '^5' "$CRASHDIR"/configs/servers.list | sed -n ""$rule_link"p" | awk '{print $2}') now=$(grep -aE '^5' "$CRASHDIR"/configs/servers.list | sed -n ""$rule_link"p" | awk '{print $2}')
separator_line "-" comp_box "当前使用规则为:\033[33m$now\033[0m"
content_line "当前使用规则为:\033[33m$now\033[0m"
separator_line "-"
list_box "$list" list_box "$list"
separator_line "-" content_line ""
common_back common_back
read -r -p "请输入对应数字 > " num read -r -p "请输入对应数字> " num
totalnum=$(grep -acE '^5' "$CRASHDIR"/configs/servers.list ) totalnum=$(grep -acE '^5' "$CRASHDIR"/configs/servers.list)
if [ -z "$num" ] || [ "$num" -gt "$totalnum" ];then if [ -z "$num" ] || [ "$num" -gt "$totalnum" ]; then
errornum errornum
elif [ "$num" = 0 ];then elif [ "$num" = 0 ]; then
echo echo
elif [ "$num" -le "$totalnum" ];then elif [ "$num" -le "$totalnum" ]; then
#将对应标记值写入配置 # 将对应标记值写入配置
rule_link=$num rule_link=$num
setconfig rule_link $rule_link if setconfig rule_link "$rule_link"; then
separator_line "-" msg_alert "\033[32m设置成功返回上级菜单\033[0m"
content_line "\033[32m设置成功返回上级菜单\033[0m" else
common_failed
fi
fi fi
} }
gen_link_server() { #选择Subconverter服务器 # 选择Subconverter服务器
gen_link_server() {
list=$(grep -aE '^3|^4' "$CRASHDIR"/configs/servers.list | awk '{print $3" "$2}') list=$(grep -aE '^3|^4' "$CRASHDIR"/configs/servers.list | awk '{print $3" "$2}')
now=$(grep -aE '^3|^4' "$CRASHDIR"/configs/servers.list | sed -n ""$server_link"p" | awk '{print $3}') now=$(grep -aE '^3|^4' "$CRASHDIR"/configs/servers.list | sed -n ""$server_link"p" | awk '{print $3}')
separator_line "-"
content_line "\033[36m以下为互联网采集的第三方服务器具体安全性请自行斟酌\033[0m" comp_box "\033[36m以下为互联网采集的第三方服务器具体安全性请自行斟酌\033[0m" \
content_line "\033[32m感谢以下作者的无私奉献\033[0m" "\033[32m感谢以下作者的无私奉献\033[0m" \
content_line "当前使用后端为:\033[33m$now\033[0m" "" \
separator_line "-" "当前使用后端为:\033[33m$now\033[0m"
list_box "$list" list_box "$list"
content_line ""
common_back common_back
read -r -p "请输入对应数字 > " num read -r -p "请输入对应数字> " num
totalnum=$(grep -acE '^3|^4' "$CRASHDIR"/configs/servers.list ) totalnum=$(grep -acE '^3|^4' "$CRASHDIR"/configs/servers.list)
if [ -z "$num" ] || [ "$num" -gt "$totalnum" ];then if [ -z "$num" ] || [ "$num" -gt "$totalnum" ]; then
errornum errornum
elif [ "$num" = 0 ];then elif [ "$num" = 0 ]; then
echo echo
elif [ "$num" -le "$totalnum" ];then elif [ "$num" -le "$totalnum" ]; then
#将对应标记值写入配置 # 将对应标记值写入配置
server_link=$num server_link=$num
setconfig server_link $server_link if setconfig server_link "$server_link"; then
separator_line "-"
content_line "\033[32m设置成功返回上级菜单\033[0m" content_line "\033[32m设置成功返回上级菜单\033[0m"
else
common_failed
fi
fi fi
} }
set_sub_ua() { set_sub_ua() {
separator_line "-" while true; do
content_line "\033[36m无法正确获取配置文件时可尝试使用\033[0m" comp_box "\033[36m无法正确获取配置文件时可尝试使用\033[0m" \
content_line " 1 使用自动UA(默认)" "" \
content_line " 2 不使用UA" "当前UA$user_agent"
content_line " 3 使用自定义UA\033[32m$user_agent\033[0m" btm_box "1) 使用自动UA默认"\
separator_line "-" "2) 不使用UA"\
read -r -p "请输入对应数字 > " num "3) 使用自定义UA"\
"4) 清空UA"\
""\
"0) 返回上级菜单"
read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
0) 0)
user_agent='' break
;; ;;
1) 1)
user_agent='auto' user_agent='auto'
@@ -166,12 +188,32 @@ set_sub_ua() {
user_agent='none' user_agent='none'
;; ;;
3) 3)
read -r -p "请输入自定义UA(不要包含空格特殊符号!) > " text comp_box "\033[33m注意\n自定义UA不可包含空格特殊符号!\033[0m"
[ -n "$text" ] && user_agent="$text" btm_box "\033[36m请直接输入自定义UA\033[0m" \
"或输入 0 返回上级菜单"
read -r -p "请输入> " text
if [ "$text" = 0 ]; then
continue
elif [ -n "$text" ]; then
user_agent="$text"
fi
;;
4)
user_agent=''
;; ;;
*) *)
errornum errornum
continue
;; ;;
esac esac
[ "$num" -le 3 ] && setconfig user_agent "$user_agent"
if [ "$num" -ge 1 ] && [ "$num" -le 4 ]; then
if setconfig user_agent "$user_agent"; then
common_success
else
common_failed
fi
fi
break
done
} }

View File

@@ -14,7 +14,11 @@ task_logger(){
[ "$task_push" = 1 ] && push= || push=off [ "$task_push" = 1 ] && push= || push=off
[ -n "$2" -a "$2" != 0 ] && echo -e "\033[$2m$1\033[0m" [ -n "$2" -a "$2" != 0 ] && echo -e "\033[$2m$1\033[0m"
[ "$3" = 'off' ] && push=off [ "$3" = 'off' ] && push=off
echo "$1" |grep -qE '(每隔|时每)([1-9]|[1-9][0-9])分钟' || logger "$1" 0 "$push" echo "$1" |grep -qE '(每隔|时每)([1-9]|[1-9][0-9])分钟' && {
push=off
cover=on
}
logger "$1" 0 "$push" "$cover"
} }
#任务命令 #任务命令
@@ -31,7 +35,7 @@ update_core(){ #自动更新内核
task_logger "任务【自动更新内核】中止-未检测到版本更新" task_logger "任务【自动更新内核】中止-未检测到版本更新"
return 0 return 0
else else
. "$CRASHDIR"/libs/core_webget.sh && core_webget #调用下载工具 . "$CRASHDIR"/libs/core_tools.sh && core_webget #调用下载工具
case "$?" in case "$?" in
0) 0)
task_logger "任务【自动更新内核】下载完成,正在重启服务!" task_logger "任务【自动更新内核】下载完成,正在重启服务!"
@@ -57,18 +61,18 @@ update_scripts(){ #自动更新脚本
task_logger "任务【自动更新脚本】中止-未检测到版本更新" task_logger "任务【自动更新脚本】中止-未检测到版本更新"
return 0 return 0
else else
get_bin "$TMPDIR"/clashfm.tar.gz "bin/update.tar.gz" get_bin "$TMPDIR"/ShellCrash.tar.gz "ShellCrash.tar.gz"
if [ "$?" != "0" ];then if [ "$?" != "0" ];then
rm -rf "$TMPDIR"/clashfm.tar.gz rm -rf "$TMPDIR"/ShellCrash.tar.gz
task_logger "任务【自动更新内核】出错-下载失败!" task_logger "任务【自动更新内核】出错-下载失败!"
return 1 return 1
else else
#停止服务 #停止服务
"$CRASHDIR"/start.sh stop "$CRASHDIR"/start.sh stop
#解压 #解压
tar -zxf "$TMPDIR"/clashfm.tar.gz ${tar_para} -C "$CRASHDIR"/ tar -zxf "$TMPDIR"/ShellCrash.tar.gz ${tar_para} -C "$CRASHDIR"/
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
rm -rf "$TMPDIR"/clashfm.tar.gz rm -rf "$TMPDIR"/ShellCrash.tar.gz
task_logger "任务【自动更新内核】出错-解压失败!" task_logger "任务【自动更新内核】出错-解压失败!"
"$CRASHDIR"/start.sh start "$CRASHDIR"/start.sh start
return 1 return 1
@@ -115,7 +119,7 @@ reset_firewall(){ #重设透明路由防火墙
"$CRASHDIR"/start.sh afstart "$CRASHDIR"/start.sh afstart
} }
ntp(){ ntp(){
[ "$crashcore" != singbox ] && ckcmd ntpd && ntpd -n -q -p 203.107.6.88 >/dev/null 2>&1 || exit 0 ckcmd ntpd && ntpd -n -q -p 203.107.6.88 >/dev/null 2>&1 || exit 0
} }
web_save_auto(){ web_save_auto(){
. "$CRASHDIR"/libs/web_save.sh && web_save . "$CRASHDIR"/libs/web_save.sh && web_save

View File

@@ -113,11 +113,7 @@ content_line() {
END {} END {}
' '
} }
# function for right side text
# color sould be disabled
content_right() {
content_line "$(printf "%$((${TABLE_WIDTH:-60} - 3))s" "$1")"
}
# function to print sub content lines # function to print sub content lines
# for printing accompanying instructions # for printing accompanying instructions
sub_content_line() { sub_content_line() {
@@ -150,5 +146,3 @@ separator_line() {
line_break() { line_break() {
printf "\n\n" printf "\n\n"
} }

View File

@@ -5,9 +5,6 @@ content_line() {
printf '%b' " $1\n" printf '%b' " $1\n"
} }
content_right() {
printf "%$((TABLE_WIDTH - 13))s\n" "$1"
}
sub_content_line() { sub_content_line() {
content_line " $1" content_line " $1"
} }
@@ -19,4 +16,3 @@ separator_line() {
line_break() { line_break() {
return return
} }

View File

@@ -3,12 +3,10 @@
# 卸载 # 卸载
uninstall() { uninstall() {
comp_box "\033[31m警告\033[0m" \ comp_box "\033[31m警告该操作不可逆!\033[0m" \
"\033[31m该操作不可逆\033" \ "是否确认卸载ShellCrash"
"是否确认卸载ShellCrash" btm_box "1) 是" \
content_line "1) " "0) "
content_line "0) 否"
separator_line "="
read -r -p "$COMMON_INPUT> " res read -r -p "$COMMON_INPUT> " res
if [ "$res" = '1' ]; then if [ "$res" = '1' ]; then
# 停止服务 # 停止服务
@@ -20,10 +18,9 @@ uninstall() {
# 移除安装目录 # 移除安装目录
if [ -n "$CRASHDIR" ] && [ "$CRASHDIR" != '/' ]; then if [ -n "$CRASHDIR" ] && [ "$CRASHDIR" != '/' ]; then
comp_box "是否保留脚本配置及订阅文件" comp_box "是否保留脚本配置及订阅文件"
content_line "1) 是" btm_box "1) 是" \
content_line "0) 否" "0) 否"
separator_line "="
read -r -p "$COMMON_INPUT> " res read -r -p "$COMMON_INPUT> " res
if [ "$res" = '1' ]; then if [ "$res" = '1' ]; then
mv -f "$CRASHDIR"/configs /tmp/ShellCrash/configs_bak mv -f "$CRASHDIR"/configs /tmp/ShellCrash/configs_bak

View File

@@ -4,24 +4,25 @@
[ -n "$__IS_MODULE_USERGUIDE_LOADED" ] && return [ -n "$__IS_MODULE_USERGUIDE_LOADED" ] && return
__IS_MODULE_USERGUIDE_LOADED=1 __IS_MODULE_USERGUIDE_LOADED=1
load_lang userguide
forwhat() { forwhat() {
while true; do while true; do
echo "-----------------------------------------------" comp_box "\033[30;46m$UG_WELCOME\033[0m" \
echo -e "\033[30;46m 欢迎使用ShellCrash新手引导 \033[0m" "" \
echo "-----------------------------------------------" "\033[33m$UG_CHOOSE_ENV\033[0m" \
echo -e "\033[33m请先选择你的使用环境 \033[0m" "\033[0m$UG_TIP_CONFIG\033[0m"
echo -e "\033[0m(你之后依然可以在设置中更改各种配置)\033[0m"
echo "-----------------------------------------------" content_line "1) \033[32m$UG_OPTION_1\033[0m"
echo -e " 1 \033[32m路由设备配置局域网透明代理\033[0m" content_line "2) \033[36m$UG_OPTION_2\033[0m"
echo -e " 2 \033[36mLinux设备仅配置本机代理\033[0m" [ -s "$CRASHDIR"/configs.tar.gz ] && content_line "3) \033[33m$UG_OPTION_3\033[0m"
[ -f "$CFG_PATH.bak" ] && echo -e " 3 \033[33m还原之前备份的设置\033[0m" separator_line "="
echo "-----------------------------------------------" read -r -p "$COMMON_INPUT> " num
read -r -p "请输入对应数字 > " num
case "$num" in case "$num" in
"" | 1) "" | 1)
# 设置运行模式 # 设置运行模式
redir_mod="Mix" redir_mod="Mix"
echo "$cputype" | grep -Eq 'linux.*mips.*' && { content_line "$cputype" | grep -Eq 'linux.*mips.*' && {
if grep -qE '^TPROXY$' /proc/net/ip_tables_targets || modprobe xt_TPROXY >/dev/null 2>&1; then if grep -qE '^TPROXY$' /proc/net/ip_tables_targets || modprobe xt_TPROXY >/dev/null 2>&1; then
redir_mod="Tproxy" redir_mod="Tproxy"
else else
@@ -53,13 +54,13 @@ forwhat() {
autostart=enable autostart=enable
# 检测IP转发 # 检测IP转发
if [ "$(cat /proc/sys/net/ipv4/ip_forward)" = "0" ]; then if [ "$(cat /proc/sys/net/ipv4/ip_forward)" = "0" ]; then
echo "-----------------------------------------------" separator_line "-"
echo -e "\033[33m检测到你的设备尚未开启ip转发局域网设备将无法正常连接网络是否立即开启\033[0m" content_line "\033[33m$UG_IP_FORWARD_WARN\033[0m"
read -r -p "是否开启?(1/0) > " res read -r -p "$COMMON_INPUT_R" res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
echo 'net.ipv4.ip_forward = 1' >>/etc/sysctl.conf content_line 'net.ipv4.ip_forward = 1' >>/etc/sysctl.conf
sysctl -w net.ipv4.ip_forward=1 sysctl -w net.ipv4.ip_forward=1
} && echo "已成功开启ipv4转发如未正常开启请手动重启设备" || echo "开启失败!请自行谷歌查找当前设备的开启方法!" }
fi fi
# 禁止docker启用的net.bridge.bridge-nf-call-iptables # 禁止docker启用的net.bridge.bridge-nf-call-iptables
sysctl -w net.bridge.bridge-nf-call-iptables=0 >/dev/null 2>&1 sysctl -w net.bridge.bridge-nf-call-iptables=0 >/dev/null 2>&1
@@ -68,20 +69,19 @@ forwhat() {
;; ;;
2) 2)
setconfig redir_mod "Redir" setconfig redir_mod "Redir"
echo "$cputype" | grep -Eq "linux.*mips.*" && setconfig crashcore "clash" content_line "$cputype" | grep -Eq "linux.*mips.*" && setconfig crashcore "clash"
setconfig common_ports "OFF" setconfig common_ports "OFF"
setconfig firewall_area '2' setconfig firewall_area '2'
break break
;; ;;
3) 3)
mv -f "$CFG_PATH.bak" "$CFG_PATH" tar -zxf "$CRASHDIR"/configs.tar.gz -C "$CRASHDIR"/configs
echo -e "\033[32m脚本设置已还原!\033[0m" msg_alert "\033[32m$UG_RESTORE_OK\033[0m"
echo -e "\033[33m请重新启动脚本\033[0m" line_break
exit 0 exit 0
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -95,36 +95,25 @@ userguide() {
# 检测小内存模式 # 检测小内存模式
dir_size=$(dir_avail "$CRASHDIR") dir_size=$(dir_avail "$CRASHDIR")
if [ "$dir_size" -lt 10240 ]; then if [ "$dir_size" -lt 10240 ]; then
echo "-----------------------------------------------" comp_box "\033[33m$UG_ENABLE_LOW_MEM\033[0m"
echo -e "\033[33m检测到你的安装目录空间不足10M是否开启小闪存模式\033[0m" read -r -p "$COMMON_INPUT_R" res
echo -e "\033[0m开启后核心及数据库文件将被下载到内存中这将占用一部分内存空间\033[0m"
echo -e "\033[0m每次开机后首次运行服务时都会自动的重新下载相关文件\033[0m"
echo "-----------------------------------------------"
read -r -p "是否开启?(1/0) > " res
[ "$res" = 1 ] && { [ "$res" = 1 ] && {
BINDIR=/tmp/ShellCrash BINDIR=/tmp/ShellCrash
setconfig BINDIR /tmp/ShellCrash "$CRASHDIR"/configs/command.env sed -i "s#BINDIR=.*#BINDIR=$BINDIR" "$CRASHDIR"/configs/command.env
} }
fi fi
# 启用推荐的自动任务配置 # 启用推荐的自动任务配置
. "$CRASHDIR"/menus/5_task.sh && task_recom . "$CRASHDIR"/menus/5_task.sh && task_recom
# 小米设备软固化
if [ "$systype" = "mi_snapshot" ]; then
echo "-----------------------------------------------"
echo -e "\033[33m检测到为小米路由设备启用软固化可防止路由升级后丢失SSH\033[0m"
read -r -p "是否启用软固化功能?(1/0) > " res
[ "$res" = 1 ] && mi_autoSSH
fi
# 提示导入订阅或者配置文件 # 提示导入订阅或者配置文件
if [ ! -s "$CRASHDIR"/yamls/config.yaml ] && [ ! -s "$CRASHDIR"/jsons/config.json ]; then if [ ! -s "$CRASHDIR"/yamls/config.yaml ] && [ ! -s "$CRASHDIR"/jsons/config.json ]; then
echo "-----------------------------------------------" comp_box "\033[0m$UG_IMPORT_CONFIG\033[0m" \
echo -e "\033[32m是否导入配置文件?\033[0m(这是运行前的最后一步)" "\033[32m$UG_CONFIG_TIP\033[0m" \
echo -e "\033[0m你必须拥有一份配置文件才能运行服务\033[0m" "$UG_CONFIG_RES"
echo "-----------------------------------------------" btm_box "1) 立即导入" \
read -r -p "现在开始导入?(1/0) > " res "0) 暂不导入"
read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && inuserguide=1 && { [ "$res" = 1 ] && inuserguide=1 && {
. "$CRASHDIR"/menus/6_core_config.sh && set_core_config . "$CRASHDIR"/menus/6_core_config.sh && set_core_config
inuserguide="" inuserguide=""
@@ -132,10 +121,6 @@ userguide() {
fi fi
# 回到主界面 # 回到主界面
echo "-----------------------------------------------" msg_alert "\033[36m$UG_FINAL_TIP\033[0m"
echo -e "\033[36m很好现在只需要执行启动就可以愉快的使用了\033[0m"
echo "-----------------------------------------------"
read -r -p "立即启动服务?(1/0) > " res
[ "$res" = 1 ] && start_core && sleep 2
return 0 return 0
} }

View File

@@ -37,7 +37,7 @@ case "$1" in
start) start)
[ -n "$(pidof CrashCore)" ] && $0 stop #禁止多实例 [ -n "$(pidof CrashCore)" ] && $0 stop #禁止多实例
stop_firewall #清理路由策略 stop_firewall #清理路由策略
rm -f "CRASHDIR"/.start_error #移除自启失败标记 rm -f "$CRASHDIR"/\.start_error #移除自启失败标记
#使用不同方式启动服务 #使用不同方式启动服务
if [ "$firewall_area" = "5" ]; then #主旁转发 if [ "$firewall_area" = "5" ]; then #主旁转发
. "$CRASHDIR"/starts/fw_start.sh . "$CRASHDIR"/starts/fw_start.sh
@@ -67,10 +67,10 @@ start)
stop) stop)
logger ShellCrash服务即将关闭...... logger ShellCrash服务即将关闭......
[ -n "$(pidof CrashCore)" ] && web_save #保存面板配置 [ -n "$(pidof CrashCore)" ] && web_save #保存面板配置
#删除守护进程&面板配置自动保存 #清理定时任务
cronset '保守模式守护进程' cronload | grep -vE '^$|start_legacy_wd.sh|运行时每' > "$TMPDIR"/cron_tmp
cronset '运行时每' cronadd "$TMPDIR"/cron_tmp
cronset '流媒体预解析' rm -f "$TMPDIR"/cron_tmp
#停止tg_bot #停止tg_bot
. "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop
#多种方式结束进程 #多种方式结束进程

View File

@@ -21,8 +21,6 @@ if [ -n "$test" -o -n "$(pidof CrashCore)" ]; then
[ "$start_old" = "ON" ] && [ ! -L "$TMPDIR"/CrashCore ] && rm -f "$TMPDIR"/CrashCore #删除缓存目录内核文件 [ "$start_old" = "ON" ] && [ ! -L "$TMPDIR"/CrashCore ] && rm -f "$TMPDIR"/CrashCore #删除缓存目录内核文件
. "$CRASHDIR"/starts/fw_start.sh #配置防火墙流量劫持 . "$CRASHDIR"/starts/fw_start.sh #配置防火墙流量劫持
date +%s >"$TMPDIR"/crash_start_time #标记启动时间 date +%s >"$TMPDIR"/crash_start_time #标记启动时间
#TG机器人守护进程
[ "$bot_tg_service" = ON ] && . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_cron
#后台还原面板配置 #后台还原面板配置
[ -s "$CRASHDIR"/configs/web_save ] && { [ -s "$CRASHDIR"/configs/web_save ] && {
. "$CRASHDIR"/libs/web_restore.sh . "$CRASHDIR"/libs/web_restore.sh
@@ -33,27 +31,26 @@ if [ -n "$test" -o -n "$(pidof CrashCore)" ]; then
sleep 5 sleep 5
logger ShellCrash服务已启动 logger ShellCrash服务已启动
} & } &
ckcmd mtd_storage.sh && mtd_storage.sh save >/dev/null 2>&1 & #Padavan保存/etc/storage ckcmd mtd_storage.sh && mtd_storage.sh save >/dev/null 2>&1 #Padavan保存/etc/storage
#加载定时任务 #加载定时任务
[ -s "$CRASHDIR"/task/cron ] && croncmd "$CRASHDIR"/task/cron cronload | grep -v '^$' > "$TMPDIR"/cron_tmp
[ -s "$CRASHDIR"/task/running ] && { [ -s "$CRASHDIR"/task/cron ] && cat "$CRASHDIR"/task/cron >> "$TMPDIR"/cron_tmp
cronset '运行时每' [ -s "$CRASHDIR"/task/running ] && cat "$CRASHDIR"/task/running >> "$TMPDIR"/cron_tmp
while read line; do [ "$bot_tg_service" = ON ] && echo "* * * * * /bin/sh $CRASHDIR/starts/start_legacy_wd.sh bot_tg #ShellCrash-TG_BOT守护进程" >> "$TMPDIR"/cron_tmp
cronset '2fjdi124dd12s' "$line" [ "$start_old" = ON ] && echo "* * * * * /bin/sh $CRASHDIR/starts/start_legacy_wd.sh shellcrash #ShellCrash保守模式守护进程" >> "$TMPDIR"/cron_tmp
done <"$CRASHDIR"/task/running awk '!x[$0]++' "$TMPDIR"/cron_tmp > "$TMPDIR"/cron_tmp2 #删除重复行
} cronadd "$TMPDIR"/cron_tmp2
[ "$start_old" = "ON" ] && cronset '保守模式守护进程' "* * * * * /bin/sh $CRASHDIR/starts/start_legacy_wd.sh shellcrash #ShellCrash保守模式守护进程" rm -f "$TMPDIR"/cron_tmp "$TMPDIR"/cron_tmp2
#加载条件任务 #加载条件任务
[ -s "$CRASHDIR"/task/afstart ] && { . "$CRASHDIR"/task/afstart; } & [ -s "$CRASHDIR"/task/afstart ] && { . "$CRASHDIR"/task/afstart; } &
[ -s "$CRASHDIR"/task/affirewall -a -s /etc/init.d/firewall -a ! -f /etc/init.d/firewall.bak ] && { [ -s "$CRASHDIR"/task/affirewall -a -s /etc/init.d/firewall -a ! -f /etc/init.d/firewall.bak ] && {
#注入防火墙 #注入防火墙
line=$(grep -En "fw.* restart" /etc/init.d/firewall | cut -d ":" -f 1) line=$(grep -En "fw.* restart" /etc/init.d/firewall | cut -d ":" -f 1)
sed -i.bak "${line}a\\. "$CRASHDIR"/task/affirewall" /etc/init.d/firewall sed -i.bak "${line}a\\. $CRASHDIR/task/affirewall" /etc/init.d/firewall
line=$(grep -En "fw.* start" /etc/init.d/firewall | cut -d ":" -f 1) line=$(grep -En "fw.* start" /etc/init.d/firewall | cut -d ":" -f 1)
sed -i "${line}a\\. $CRASHDIR/task/affirewall" /etc/init.d/firewall sed -i "${line}a\\. $CRASHDIR/task/affirewall" /etc/init.d/firewall
} & } &
exit 0 exit 0
else else
. "$CRASHDIR"/starts/start_error.sh . "$CRASHDIR"/starts/start_error.sh
"$CRASHDIR"/start.sh stop
fi fi

View File

@@ -8,7 +8,7 @@
[ ! -f "$TMPDIR" ] && mkdir -p "$TMPDIR" [ ! -f "$TMPDIR" ] && mkdir -p "$TMPDIR"
#当上次启动失败时终止自启动 #当上次启动失败时终止自启动
[ -f "CRASHDIR"/.start_error ] && exit 1 [ -f "$CRASHDIR"/.start_error ] && exit 1
#加载工具 #加载工具
. "$CRASHDIR"/libs/check_cmd.sh . "$CRASHDIR"/libs/check_cmd.sh
. "$CRASHDIR"/libs/check_target.sh . "$CRASHDIR"/libs/check_target.sh

View File

@@ -11,10 +11,10 @@ clash_check() { #clash启动前检查
[ "$crashcore" = "clash" ] && [ "$firewall_area" = 2 -o "$firewall_area" = 3 ] && [ -z "$(grep '0:7890' /etc/passwd)" ] && [ "$crashcore" = "clash" ] && [ "$firewall_area" = 2 -o "$firewall_area" = 3 ] && [ -z "$(grep '0:7890' /etc/passwd)" ] &&
core_exchange meta '当前内核不支持非root用户启用本机代理' core_exchange meta '当前内核不支持非root用户启用本机代理'
check_core check_core
#预下载GeoIP数据库并排除存在自定义数据库链接的情况 #预下载GeoIP数据库
[ -n "$(grep -oEi 'geoip:' "$CRASHDIR"/yamls/config.yaml)" ] && check_geo Country.mmdb cn_mini.mmdb grep -qEi 'GEOIP,CN' "$CRASHDIR"/yamls/config.yaml && ! grep -Eq '^[[:space:]]*geodata-mode:' "$CRASHDIR"/yamls/*.yaml && check_geo Country.mmdb cn_mini.mmdb
#预下载GeoSite数据库并排除存在自定义数据库链接的情况 #预下载GeoSite数据库
[ -n "$(grep -oEi 'geosite:' "$CRASHDIR"/yamls/config.yaml)" ] && check_geo GeoSite.dat geosite.dat grep -qEi 'GEOSITE,' "$CRASHDIR"/yamls/config.yaml && ! grep -Eq '^[[:space:]]*geosite:' "$CRASHDIR"/yamls/*.yaml && check_geo GeoSite.dat geosite.dat
#预下载cn.mrs数据库 #预下载cn.mrs数据库
[ "$dns_mod" = "mix" ] || [ "$dns_mod" = "route" ] && ! grep -Eq '^[[:space:]]*cn:' "$CRASHDIR"/yamls/*.yaml && check_geo ruleset/cn.mrs mrs_geosite_cn.mrs [ "$dns_mod" = "mix" ] || [ "$dns_mod" = "route" ] && ! grep -Eq '^[[:space:]]*cn:' "$CRASHDIR"/yamls/*.yaml && check_geo ruleset/cn.mrs mrs_geosite_cn.mrs
return 0 return 0

View File

@@ -15,9 +15,9 @@ update_servers() { #更新servers.list
gen_ua(){ #自动生成ua gen_ua(){ #自动生成ua
[ -z "$user_agent" -o "$user_agent" = "auto" ] && { [ -z "$user_agent" -o "$user_agent" = "auto" ] && {
if echo "$crashcore" | grep -q 'singbox'; then if echo "$crashcore" | grep -q 'singbox'; then
user_agent="sing-box/singbox/$core_v" user_agent="sing-box/$core_v"
elif [ "$crashcore" = meta ]; then elif [ "$crashcore" = meta ]; then
user_agent="clash.meta/mihomo/$core_v" user_agent="clash.meta/mihomo"
else else
user_agent="clash" user_agent="clash"
fi fi
@@ -42,6 +42,8 @@ get_core_config() { #下载内核配置文件
fi fi
Https="${Server}/sub?target=${target}&${Server_ua}=${user_agent}&insert=true&new_name=true&scv=true&udp=true&${urlencodeUrl}" Https="${Server}/sub?target=${target}&${Server_ua}=${user_agent}&insert=true&new_name=true&scv=true&udp=true&${urlencodeUrl}"
url_type=true url_type=true
else
Https=$(echo $Https | sed 's/\\&/\&/g') #还原转义
fi fi
#输出 #输出
echo "-----------------------------------------------" echo "-----------------------------------------------"
@@ -66,7 +68,7 @@ get_core_config() { #下载内核配置文件
exit 1 exit 1
else else
retry=$((retry + 1)) retry=$((retry + 1))
logger "配置文件获取失败!" 31 logger "配置文件获取失败!" 31 off on
if [ "$retry" = 1 ]; then if [ "$retry" = 1 ]; then
echo -e "\033[32m尝试更新服务器列表并使用其他服务器获取配置\033[0m" echo -e "\033[32m尝试更新服务器列表并使用其他服务器获取配置\033[0m"
update_servers update_servers

View File

@@ -23,7 +23,7 @@ fi
#写入环境变量 #写入环境变量
set_profile "$profile" set_profile "$profile"
#启动进程或删除守护进程 #启动进程或删除守护进程
if [ -f "$CRASHDIR"/.dis_startup ];then if [ -f "$CRASHDIR"/.dis_startup ] || [ -f "$CRASHDIR"/.start_error ];then
cronset "保守模式守护进程" cronset "保守模式守护进程"
else else
"$CRASHDIR"/start.sh start "$CRASHDIR"/start.sh start

View File

@@ -200,7 +200,7 @@ EOF
EOF EOF
#生成add_route.json #生成add_route.json
#域名嗅探配置 #域名嗅探配置
[ "$sniffer" = ON ] && sniffer_set='{ "action": "sniff", "timeout": "500ms" },' [ "$sniffer" != OFF ] && sniffer_set='{ "action": "sniff", "timeout": "500ms" },'
[ "$ts_service" = ON ] && tailscale_set='{ "inbound": [ "ts-ep" ], "port": 53, "action": "hijack-dns" },' [ "$ts_service" = ON ] && tailscale_set='{ "inbound": [ "ts-ep" ], "port": 53, "action": "hijack-dns" },'
cat >"$TMPDIR"/jsons/add_route.json <<EOF cat >"$TMPDIR"/jsons/add_route.json <<EOF
{ {

View File

@@ -2,6 +2,10 @@
# Copyright (C) Juewuy # Copyright (C) Juewuy
CRASHDIR="$(uci get firewall.ShellCrash.path | sed 's/\/starts.*//')" CRASHDIR="$(uci get firewall.ShellCrash.path | sed 's/\/starts.*//')"
#防止提前自启
/etc/init.d/shellcrash disable
crontab -l | grep -v 'start_legacy_wd.sh shellcrash' | crontab -
#防止usb未加载
i=0 i=0
while [ ! -f "$CRASHDIR/configs/ShellCrash.cfg" ]; do while [ ! -f "$CRASHDIR/configs/ShellCrash.cfg" ]; do
[ $i -gt 20 ] && exit 1 [ $i -gt 20 ] && exit 1
@@ -67,11 +71,11 @@ auto_start(){
set_profile '/etc/profile' set_profile '/etc/profile'
} }
#启动服务 #启动服务
if [ ! -f "$CRASHDIR"/.dis_startup ]; then if [ ! -f "$CRASHDIR"/.dis_startup ] && [ ! -f "$CRASHDIR"/.start_error ]; then
#AX6S/AX6000修复tun功能 #AX6S/AX6000修复tun功能
[ -s "$CRASHDIR"/tools/tun.ko ] && tunfix [ -s "$CRASHDIR"/tools/tun.ko ] && tunfix
#小米7000/小米万兆修复tproxy #小米7000/小米万兆修复tproxy
[ -f /etc/init.d/qca-nss-ecm ] && [ "$redir_mod" = 'Tproxy' ] && tproxyfix [ -f /etc/init.d/qca-nss-ecm ] && echo "$redir_mod" | grep -q 'Tproxy' && tproxyfix
#自动覆盖根证书文件 #自动覆盖根证书文件
[ -s "$CRASHDIR"/tools/ca-certificates.crt ] && cp -f "$CRASHDIR"/tools/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt [ -s "$CRASHDIR"/tools/ca-certificates.crt ] && cp -f "$CRASHDIR"/tools/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
#启动服务 #启动服务

View File

@@ -11,3 +11,4 @@ touch "$CRASHDIR"/.start_error #标记启动失败,防止自启
error=$(cat "$TMPDIR"/core_test.log | grep -iEo 'error.*=.*|.*ERROR.*|.*FATAL.*') error=$(cat "$TMPDIR"/core_test.log | grep -iEo 'error.*=.*|.*ERROR.*|.*FATAL.*')
logger "服务启动失败!请查看报错信息!详细信息请查看$TMPDIR/core_test.log" 33 logger "服务启动失败!请查看报错信息!详细信息请查看$TMPDIR/core_test.log" 33
logger "$error" 31 logger "$error" 31
"$CRASHDIR"/start.sh stop

View File

@@ -1,18 +1,30 @@
[ -z "$CRASHDIR" ] && CRASHDIR=$( cd $(dirname $0);cd ..;pwd) [ -z "$CRASHDIR" ] && CRASHDIR=$(cd "$(dirname "$0")"/.. && pwd)
PIDFILE="/tmp/ShellCrash/$1.pid" PIDFILE="/tmp/ShellCrash/$1.pid"
LOCKDIR="/tmp/ShellCrash/start_$1.lock"
[ -f "$CRASHDIR"/.start_error ] && [ ! -f /tmp/ShellCrash/crash_start_time ] && exit 1 #当启动失败后禁止开机自启动
mkdir "$LOCKDIR" 2>/dev/null || exit 1
if [ -f "$PIDFILE" ]; then if [ -f "$PIDFILE" ]; then
PID="$(cat "$PIDFILE")" PID="$(cat "$PIDFILE")"
if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then if [ -n "$PID" ] && [ "$PID" -eq "$PID" ] 2>/dev/null; then
return 0 if kill -0 "$PID" 2>/dev/null || [ -d "/proc/$PID" ]; then
rm -d "$LOCKDIR" 2>/dev/null
exit 0
fi
else
rm -f "$PIDFILE"
fi fi
fi fi
#如果没有进程则拉起 #如果没有进程则拉起
if [ "$1" = shellcrash ];then if [ "$1" = "shellcrash" ]; then
"$CRASHDIR"/start.sh start "$CRASHDIR"/start.sh start
else else
. "$CRASHDIR"/starts/start_legacy.sh [ -f "$CRASHDIR/starts/start_legacy.sh" ] && . "$CRASHDIR/starts/start_legacy.sh"
killall bot_tg.sh 2>/dev/null
start_legacy "$CRASHDIR/menus/bot_tg.sh" "$1" start_legacy "$CRASHDIR/menus/bot_tg.sh" "$1"
fi fi
rm -d "$LOCKDIR" 2>/dev/null

View File

@@ -1 +1 @@
1.9.5alpha6.3 1.9.5alpha11