154 Commits

Author SHA1 Message Date
juewuy
b4363195f3 Merge pull request #1234 from juewuy/codex/implement-localization-in-menus-directory-la67cz
Add i18n language files and replace hardcoded UI strings across menus
2026-03-11 19:39:36 +08:00
juewuy
8bcaac1f66 feat(i18n): localize settings and dns menu leftovers 2026-03-11 19:39:05 +08:00
juewuy
e84bca30b9 Merge pull request #1233 from juewuy/codex/implement-localization-in-menus-directory-inwhs3
Introduce i18n support and add English/Chinese language files; replace hardcoded UI strings
2026-03-11 18:39:13 +08:00
juewuy
81d6b36c51 feat(i18n): localize set_crashdir and bot_tg menus 2026-03-11 18:38:54 +08:00
juewuy
0f96cc8c0e Merge pull request #1232 from juewuy/codex/implement-localization-in-menus-directory
feat(i18n): localize uninstall and subconverter menus
2026-03-11 18:00:01 +08:00
juewuy
c5da0da08a feat(i18n): localize uninstall and subconverter menus 2026-03-11 17:56:55 +08:00
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
112 changed files with 4432 additions and 3775 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
@@ -131,3 +131,33 @@ ADV_TABLE_INPUT="请输入路由表编号(不清楚请勿修改,建议 102-1
# ================================================= # =================================================
IPV6_REDIR="IPv6透明路由劫持IPv6流量" IPV6_REDIR="IPv6透明路由劫持IPv6流量"
IPV6_DNS="IPv6-DNS解析是否返回IPv6地址" IPV6_DNS="IPv6-DNS解析是否返回IPv6地址"
SET_YES="是"
SET_NO_BACK="否,返回上级菜单"
SET_SKIP_CERT_NOW="当前"
SET_ENABLED="已启用"
SET_DISABLED="已禁用"
SET_SKIP_CERT_ENABLE_Q="跳过本地证书验证,是否确认启用?"
SET_SKIP_CERT_DISABLE_Q="跳过本地证书验证,是否确认禁用?"
SET_SNIFFER_NOW="当前"
SET_SNIFFER_ENABLE_Q="域名嗅探,是否确认启用?"
SET_SNIFFER_DISABLE_Q="域名嗅探,是否确认禁用?"
SET_LANG_ZH="简体中文"
SET_LANG_EN="English"
SET_SWITCH_RERUN="切换成功!请重新运行脚本!"
SET_SWITCH_OK="切换成功!"
SET_MODE_SUFFIX="模式"
SET_SET_TO="设为"
SET_BYPASS_TCP="TCP旁路转发"
SET_BYPASS_TU="T&U旁路转发"
SET_BYPASS_TCP_DESC="仅转发TCP流量至旁路由"
SET_BYPASS_TU_DESC="转发TCP&UDP流量至旁路由"
SET_FW_AREA_CURRENT="当前路由劫持范围:"
SET_WARN="注意:"
SET_DESC="说明:"
SET_BYPASS_WARN_1="此功能存在多种风险如无网络基础请勿尝试!"
SET_BYPASS_WARN_2="如需代理UDP请确保旁路由运行了支持UDP代理的模式"
SET_BYPASS_WARN_3="如使用systemd方式启动内核依然会空载运行建议使用保守模式"
SET_BYPASS_DESC_1="此功能不启动内核仅配置防火墙转发且子设备无需额外设置网关DNS"
SET_BYPASS_DESC_2="支持防火墙分流及设备过滤支持部分定时任务但不支持ipv6"
SET_INPUT_BYPASS_IPV4="请直接输入旁路由IPV4地址"
SET_TIPS_ENTER_BACK="Tips直接回车确认可返回上级菜单"

View File

@@ -0,0 +1,100 @@
# 推荐任务配置
TASK_RECOM_TITLE="是否启用以下推荐的自动任务配置:"
TASK_RECOM_ITEM_1="运行时每10分钟自动保存面板配置"
TASK_RECOM_ITEM_2="服务启动后自动同步 NTP 时间"
TASK_RECOM_ITEM_3="在每日的3点0分重启服务"
TASK5_RUN_TASK="执行任务:"
TASK5_CONFIRM_ADD_CRON="是否确认添加定时任务?"
TASK5_YES="是"
TASK5_NO="否"
TASK5_TASK_PREFIX="任务【"
TASK5_TASK_ADDED="】\033[32m已添加\033[0m"
TASK5_USER_ADD_HINT1="命令可包含空格,请确保命令可执行!"
TASK5_USER_ADD_HINT2="请勿附带执行条件,执行条件请在命令添加完成后再返回设置!"
TASK5_USER_ADD_HINT3="亦可手动编辑"
TASK5_USER_ADD_HINT4="以添加命令"
TASK5_INPUT_CMD="请直接输入命令语句"
TASK5_OR_BACK="或输入 0 返回上级菜单"
TASK5_INPUT="请输入"
TASK5_CHECK_INPUT="请检查输入:"
TASK5_INPUT_REMARK="请输入任务备注"
TASK5_CUSTOM_TASK="自定义任务"
TASK5_CUSTOM_ADDED="自定义任务已添加!"
TASK5_INPUT_ERROR="输入错误,请重新输入!"
TASK5_USER_DEL_HINT1="请输入对应ID移除对应自定义任务不会影响内置任务"
TASK5_USER_DEL_HINT2="也可以手动编辑"
TASK5_NO_CUSTOM_TASK="你暂未添加任何自定义任务"
TASK5_SELECT_ADD="请选择需要添加的任务:"
TASK5_SELECT_COND="请选择任务"
TASK5_SELECT_COND2="执行条件:"
TASK5_COND_1="定时任务\033[32m每周执行\033[0m"
TASK5_COND_2="定时任务\033[32m每日执行\033[0m"
TASK5_COND_3="定时任务\033[32m每小时执行\033[0m"
TASK5_COND_4="定时任务\033[32m每分钟执行\033[0m"
TASK5_WARN_LINE1=" - - - - - - - - -\033[31m注意\033[0m- - - - - - - - -"
TASK5_WARN_LINE2=" 逻辑水平不及格的请勿使用下方触发条件!"
TASK5_WARN_LINE3=" - - - - - - - - - - - - - - - - - - - -"
TASK5_COND_5="服务\033[33m启动前执行\033[0m"
TASK5_COND_6="服务\033[33m启动后执行\033[0m"
TASK5_COND_7="服务\033[33m运行时每分钟执行\033[0m"
TASK5_COND_8="防火墙服务\033[33m重启后执行\033[0m"
TASK5_WEEK_HINT1="输入 17 对应\033[33m每周的指定某天\033[0m运行7=周日)"
TASK5_WEEK_HINT2="输入 140 代表\033[36m每周一、周四、周日\033[0m运行"
TASK5_WEEK_HINT3="输入 15 代表\033[36m周一至周五\033[0m运行"
TASK5_WEEK_INPUT="在每周哪天执行?"
TASK5_HOUR_INPUT1="想在该日的具体哪个小时执行023"
TASK5_CRON_WEEK="在每周"
TASK5_CRON_WEEK2="的"
TASK5_OCLOCK="点整"
TASK5_DAY_HINT1="输入 1715 代表\033[36m每到1715点\033[0m运行"
TASK5_DAY_HINT2="输入 618 代表\033[36m早6点至晚18点间每小时\033[0m运行"
TASK5_HOUR_INPUT2="想在每日的具体哪个小时执行0~23"
TASK5_MIN_INPUT="想在具体哪分钟执行059的整数"
TASK5_CRON_DAY="在每日的"
TASK5_POINT="点"
TASK5_MINUTE="分"
TASK5_EVERY_HOUR_INPUT="想每隔多少小时执行一次123的整数"
TASK5_EVERY="每隔"
TASK5_HOUR="小时"
TASK5_EVERY_MIN_INPUT="想每隔多少分钟执行一次159的整数"
TASK5_MIN="分钟"
TASK5_BFSTART="服务启动前"
TASK5_AFSTART="服务启动后"
TASK5_RUNNING_HINT1="输入10即每隔10分钟运行一次1440即每隔24小时运行一次"
TASK5_RUNNING_HINT2="大于60分钟的数值将按小时取整且按当前时区记时"
TASK5_RUNNING_INPUT="想每隔多少分钟执行一次11440的整数"
TASK5_RUNNING_PREFIX="运行时每"
TASK5_AFFW_HINT="该功能会将相关启动代码注入到/etc/init.d/firewall中"
TASK5_CONFIRM_CONTINUE="是否确认继续?"
TASK5_AFFW_PREFIX="防火墙重启后"
TASK5_GUARD_WORD="守护"
TASK5_OLD_PREFIX="旧版任务-"
TASK5_NONE_TO_MANAGE="当前没有可供管理的任务!"
TASK5_ADDED_TASKS="已添加的任务:"
TASK5_CLEAR_OLD="清空旧版任务"
TASK5_CLEAR_ALL="清空任务列表"
TASK5_OLD_CLEARED="旧版任务已清空!"
TASK5_ALL_CLEARED="全部任务已清空!"
TASK5_OLD_NOT_SUPPORT="旧版任务不支持管理,是否移除?"
TASK5_NO_BACK="否,返回上级菜单"
TASK5_CURRENT_TASK="当前任务为:"
TASK5_EDIT_TASK="\033[33m修改\033[0m当前任务"
TASK5_DEL_TASK="\033[31m删除\033[0m当前任务"
TASK5_RUN_ONCE="\033[32m立即执行\033[0m一次"
TASK5_VIEW_RECORD="查看\033[33m执行记录\033[0m"
TASK5_RUN_OK="执行成功!"
TASK5_RUN_FAIL="执行失败!"
TASK5_RECORD_NOT_FOUND="未找到相关执行记录!"
TASK5_USER_FILE_HEADER="#任务ID(必须>200并顺序排列)#任务命令#任务说明(#号隔开,任务命令和说明中都不允许包含#号)"
TASK5_MENU_TITLE="自动任务菜单"
TASK5_MENU_1="添加\033[32m自动任务\033[0m"
TASK5_MENU_2="管理\033[33m任务列表\033[0m"
TASK5_MENU_3="查看\033[36m任务日志\033[0m"
TASK5_MENU_4="配置\033[36m日志推送\033[0m"
TASK5_MENU_5="添加\033[33m自定义任务\033[0m"
TASK5_MENU_6="删除\033[33m自定义任务\033[0m"
TASK5_MENU_7="使用\033[32m推荐设置\033[0m"
TASK5_TASK_GREP="任务【"
TASK5_LOG_NOT_FOUND="未找到任务相关执行日志!"
TASK5_PUSH_HINT="请在日志工具中配置相关推送通道及推送开关"

View File

@@ -0,0 +1,67 @@
CORECFG_TITLE="配置文件管理"
CORECFG_HINT_SELECT_PROVIDER="输入数字可管理对应提供者"
CORECFG_MENU_A="\033[32m添加提供者\033[0m支持订阅/分享链接及本地文件)"
CORECFG_MENU_B="\033[36m本地生成配置文件\033[0m"
CORECFG_MENU_C="\033[33m在线生成配置文件\033[0m"
CORECFG_MENU_D="\033[31m清空提供者列表\033[0m"
CORECFG_MENU_E="\033[36m自定义配置文件\033[0m"
CORECFG_CORE_ONLY="仅限Mihomosingboxr内核使用请更换内核"
CORECFG_ADD_PROVIDER_FIRST="请先添加提供者!"
CORECFG_CLEAR_WARN="警告:这将删除所有提供者且无法还原!"
CORECFG_CLEAR_CONFIRM="是否确认清空提供者列表:"
CORECFG_YES="是"
CORECFG_NO="否"
CORECFG_NO_BACK="否,返回上级菜单"
CORECFG_INPUT_ALNUM="请输入对应字母或数字"
CORECFG_INPUT="请输入"
CORECFG_FILL_REQUIRED="请先完成必填选项!"
CORECFG_START_APPLY="是否启动服务以使配置文件生效:"
CORECFG_PROVIDER_SUPPORT="支持添加订阅链接/分享链接/本地文件作为提供者"
CORECFG_SET_NAME="设置\033[36m名称或代号\033[0m\t"
CORECFG_SET_LINK="设置\033[32m链接或路径\033[0m\t"
CORECFG_SET_OVERRIDE="设置\033[33m本地生成覆写\033[0m"
CORECFG_SAVE_PROVIDER="\033[36m保存此提供者\033[0m"
CORECFG_DEL_PROVIDER="\033[31m删除此提供者\033[0m"
CORECFG_MORE_CONFIG_HINT="以下方式的详细配置请前往对应功能页面进行设置!"
CORECFG_GEN_LOCAL_ONE="\033[32m本地生成\033[0m仅包含此提供者的配置文件"
CORECFG_GEN_ONLINE_ONE="\033[33m在线生成\033[0m仅包含此提供者的配置文件"
CORECFG_GET_ONLINE_DIRECT="在线获取此配置文件(不使用订阅转换)"
CORECFG_USE_DIRECT="直接使用此文件作为配置文件(不使用本地生成)"
CORECFG_NAME_HINT="注意:\n名称或代号不可重复不支持纯数字且不要超过4个汉字"
CORECFG_INPUT_NAME="请直接输入具体名称或代号"
CORECFG_OR_BACK="或输入 0 返回上级菜单"
CORECFG_LINK_HINT1="\033[33m订阅链接\033[0m\nhttps/http开头的clash配置文件订阅链接"
CORECFG_LINK_HINT2="\033[36m分享链接\033[0m"
CORECFG_LINK_HINT3="\033[33m本地文件\033[0m\n必须放在"
CORECFG_LINK_HINT4="目录下"
CORECFG_LINK_HINT5="\033[36mBase64 \033[0m\n请直接写入本地文件"
CORECFG_INPUT0_BACK="输入 0 返回上级菜单"
CORECFG_SELECT_FILE_OR_LINK="请选择对应文件或输入具体链接"
CORECFG_INPUT_LINK="请直接输入具体链接"
CORECFG_DANGER1="注意:\n此功能不兼容“跳过证书验证”功能"
CORECFG_DANGER2="请确认你完全理解自己在做什么"
CORECFG_DANGER_CONFIRM="我确认遇到问题可以自行解决"
CORECFG_INTERVAL1="设置\033[33m健康检查间隔\033[0m\t"
CORECFG_INTERVAL2="设置\033[36m自动更新间隔\033[0m\t"
CORECFG_MIN="分钟"
CORECFG_HOUR="小时"
CORECFG_SET_UA="设置\033[33m虚拟浏览器UA\033[0m\t"
CORECFG_SET_EXCLUDE="设置\033[31m排除节点正则\033[0m\t"
CORECFG_SET_INCLUDE="设置\033[32m包含节点正则\033[0m\t"
CORECFG_CUR_INTERVAL="当前健康检查间隔:"
CORECFG_INPUT_INTERVAL1="请直接健康检查间隔(单位:分钟)"
CORECFG_RESET_INTERVAL1="或输入 r 重置健康检查间隔为默认值3 分钟)"
CORECFG_INPUT_INTERVAL2="请直接输入自动更新间隔(单位:小时)"
CORECFG_RESET_INTERVAL2="或输入 r 重置自动更新间隔为默认值12 小时)"
CORECFG_CUR_UA_NONE="当前浏览器UA无"
CORECFG_CUR_UA="当前浏览器UA"
CORECFG_INPUT_UA="请直接输入浏览器UA"
CORECFG_RESET_UA="或输入 r 重置浏览器UA为默认值clash.meta"
CORECFG_CUR_EXCLUDE_NONE="当前排除规则:无"
CORECFG_CUR_EXCLUDE="当前排除规则:"
CORECFG_INPUT_EXCLUDE="请直接输入需要排除的节点关键字(支持正则,不支持空格)"
CORECFG_CLEAR_EXCLUDE="或输入 c 清空排除规则"
CORECFG_CUR_INCLUDE_NONE="当前包含规则:无"
CORECFG_CUR_INCLUDE="当前包含规则:"
CORECFG_INPUT_INCLUDE="请直接输入需要包含的节点关键字(支持正则,不支持空格)"
CORECFG_CLEAR_INCLUDE="或输入 c 清空包含规则"

View File

@@ -0,0 +1,16 @@
GW_TITLE="访问与控制菜单"
GW_WARN="注意:"
GW_FW_VPS_HINT="如在vps运行还需在vps安全策略对相关端口同时放行"
GW_FW_PORT_LIMIT="最多支持设置放行10个端口请先减少一些"
GW_INPUT_ALLOW_PORT="请输入要放行的端口号"
GW_OK="操作成功"
GW_CORE_UNSUPPORTED="内核暂不支持此功能,请先更换内核!"
GW_TG_DONE_PREFIX="已完成Telegram机器人设置请使用"
GW_TG_DONE_SUFFIX="呼出功能菜单!"
GW_SET="已设置"
GW_BOUND="已绑定"
GW_INPUT_PORT_DEL0="请输入端口号输入0删除"
GW_INPUT_WSPATH="请输入ws-path路径输入0删除"
GW_INPUT_UUID="请输入UUID输入0删除"
GW_INPUT_HOST="请输入本机公网IP(4/6)或域名"
GW_SHARE_LINK_HINT="你的分享链接是(请勿随意分享给他人):"

View File

@@ -0,0 +1,11 @@
TOOLS_TITLE="工具与优化"
TOOLS_SSH_DISABLE="禁止"
TOOLS_SSH_ENABLE="开启"
TOOLS_ERR_PORT="输入错误!请输入正确的数值(1000-65535)"
TOOLS_ERR_PORT_OCCUPIED="当前端口已被其他进程占用,请重新输入!"
TOOLS_SSH_SET_OK="设置成功请重新开启外网访问SSH功能"
TOOLS_SSH_ENABLED="已开启外网访问SSH功能"
TOOLS_SSH_DISABLED="已禁止外网访问SSH"
TOOLS_DISABLE="禁用"
TOOLS_ENABLE="启用"
TOOLS_CONFIGURED="已配置"

View File

@@ -0,0 +1,49 @@
UPG_ERR_TRY_OTHER_SOURCE="请尝试切换至其他安装源后重新下载!"
UPG_ERR_LOCAL_INSTALL="或者参考 \033[32;4mhttps://juewuy.github.io/bdaz\033[0m 进行本地安装!"
UPG_TITLE="更新与支持"
UPG_CUR_DIR_SPACE="当前目录"
UPG_LOW_SPACE_HINT="当前目录剩余空间较低,建议开启小闪存模式!"
UPG_MENU_SCRIPT="更新"
UPG_MENU_SCRIPT_NAME="管理脚本"
UPG_MENU_CORE="切换/更新"
UPG_MENU_CORE_NAME="内核文件"
UPG_MENU_GEO="安装/更新本地"
UPG_MENU_GEO_NAME="数据库文件"
UPG_MENU_DB="安装/更新本地"
UPG_MENU_DB_NAME="Dashboard面板"
UPG_MENU_CRT="安装/更新本地"
UPG_MENU_CRT_NAME="根证书文件"
UPG_MENU_PAC="自动代理查看"
UPG_MENU_SOURCE="切换"
UPG_MENU_SOURCE_NAME="安装源及版本分支"
UPG_MENU_UNINSTALL="卸载ShellCrash"
UPG_MENU_THANKS="感谢列表!"
UPG_PAC_LINK="PAC配置链接为"
UPG_PAC_GUIDE="PAC的使用教程请参考"
UPG_THANKS_TITLE="感谢以下项目及其开发者们的无私奉献!"
UPG_THANKS_SPECIAL="特别感谢:\033[36m所有帮助及赞助过此项目的同仁们\033[0m"
UPG_CHECKING="正在检查更新......"
UPG_CHECK_OK="检查更新成功"
UPG_CHECK_FAIL="检查更新失败!请尝试切换其他安装源!"
UPG_DOWNLOAD_FAIL="文件下载失败!"
UPG_EXTRACTING="开始解压文件......"
UPG_EXTRACT_FAIL="文件解压失败!"
UPG_SCRIPT_OK="脚本更新成功!"
UPG_SCRIPT_WARN="注意:更新时会停止服务!"
UPG_SCRIPT_CUR_VER="当前脚本版本为:"
UPG_SCRIPT_NEW_VER="最新脚本版本为:"
UPG_UPDATE_NOW="立即更新"
UPG_SCRIPT_MGR_OK="管理脚本更新成功!"
UPG_CPUCORE_HINT1="仅适合脚本无法正确识别核心或核心无法正常运行时使用!"
UPG_CPUCORE_HINT2="不知道如何获取核心版本?"
UPG_CPUCORE_HINT3="请参考:"
UPG_CPUCORE_LIST="当前可供在线下载的处理器架构为:"
UPG_CPUCORE_ERR="请输入正确的处理器架构!"
UPG_CORETYPE_CONFIRM="请确认该自定义内核的类型:"
UPG_CORE_SWITCH_PREFIX="已从"
UPG_CORE_SWITCH_MID="内核切换至"
UPG_CORE_SWITCH_SUFFIX="内核"
UPG_CORE_SWITCH_WARN="二者Geo数据库及yaml/json配置文件不通用"
UPG_CORE_SWITCH_KEEP="是否保留相关数据库文件?"
UPG_KEEP="保留"
UPG_NOT_KEEP="不保留"

View File

@@ -0,0 +1,68 @@
BOT_TG_PRIVATE_HINT="请先通过 \033[32;4mhttps://t.me/BotFather\033[0m 申请TG机器人并获取其\033[36mAPI TOKEN\033[0m"
BOT_TG_INPUT_TOKEN="请输入你获取到的API TOKEN"
BOT_TG_PRIVATE_TOP="请向\033[32m你申请的机器人\033[33m而不是BotFather\033[0m"
BOT_TG_PUBLIC_HINT="请向机器人:\033[32;4mhttps://t.me/ShellCrashtg_bot\033[0m"
BOT_TG_SET_DONE="已完成Telegram日志推送设置"
BOT_TG_CHATID_RETRY_PREFIX="第"
BOT_TG_CHATID_RETRY_SUFFIX="次尝试获取对话ID失败正在重试..."
BOT_TG_SEND_KEY="发送此秘钥:"
BOT_TG_SENT_CONFIRM="我已经发送完成"
BOT_TG_CHATID_FAIL="无法获取对话ID请返回重新设置或手动输入ChatID"
BOT_TG_CHATID_MANUAL_HINT="通常访问"
BOT_TG_CHATID_MANUAL_HINT2="即可看到ChatID"
BOT_TG_INPUT_CHATID="请手动输入ChatID"
BOT_TG_CHATID_RECONFIG="无法获取对话ID请重新配置"
BOT_TG_CRON_NAME="TG_BOT守护进程"
BOT_TG_HELP_GROUP="进群讨论:"
BOT_TG_HELP_PROJECT="项目地址:"
BOT_TG_HELP_GUIDE="相关教程:"
BOT_TG_HELP_COFFEE="请喝咖啡:"
BOT_TG_HELP_AIRPORT="友情机场:"
BOT_TG_RUN_ON="🟢正在运行"
BOT_TG_RUN_OFF="🟡未运行"
BOT_TG_WELCOME="欢迎使用ShellCrash"
BOT_TG_SERVICE="服务"
BOT_TG_MEM_USED="内存占用:"
BOT_TG_RUNNING_TIME="已运行:"
BOT_TG_SELECT_ACTION="请选择操作:"
BOT_TG_SELECT_FILE="请选择需要上传或下载的具体文件:"
BOT_TG_BTN_START="✈️ 启用劫持"
BOT_TG_BTN_PURE="💧 纯净模式"
BOT_TG_BTN_RESTART="🕹 重启服务"
BOT_TG_BTN_LOG="📄 查看日志"
BOT_TG_BTN_TRANSFER="🔃 文件传输"
BOT_TG_BTN_GET_LOG="📥 下载日志"
BOT_TG_BTN_GET_BAK="💾 备份设置"
BOT_TG_BTN_GET_CFG="⬇️ 下载配置"
BOT_TG_BTN_UP_CORE="🪐 上传内核"
BOT_TG_BTN_UP_BAK="🔄 还原设置"
BOT_TG_BTN_UP_CFG="⬆️ 上传配置"
BOT_TG_NO_CURL="⚠️ 因当前设备缺少curl应用仅支持上传功能"
BOT_TG_UPLOAD_OK="成功!即将重启服务!"
BOT_TG_UPLOAD_FAIL="失败,请仔细检查文件或重试!"
BOT_TG_CORE_UPDATE="内核更新"
BOT_TG_CFG_RESTORED="配置文件已还原,请手动重启服务!"
BOT_TG_RESTORE_FAIL="解压还原失败,请仔细检查文件或重试!"
BOT_TG_CFG_UPLOADED="配置文件已上传,请手动重启服务!"
BOT_TG_UPLOAD_FAIL2="上传失败,请仔细检查文件或重试!"
BOT_TG_NET_UPLOAD_FAIL="网络错误,上传失败!请重试!"
BOT_TG_FILE_FORMAT_FAIL="文件格式不匹配,上传失败!"
BOT_TG_FW_ENABLED="ShellCrash 透明路由"
BOT_TG_FW_ENABLED_SUFFIX="已启用!"
BOT_TG_SWITCH_PURE="已切换到纯净模式!"
BOT_TG_SERVICE_RESTARTED="ShellCrash 服务已重启!"
BOT_TG_UNFINISHED="错误,还未完成的功能!"
BOT_TG_SEND_CORE="请发送需要上传的内核必须是以tar.gz,.gz或.upx结尾的【"
BOT_TG_SEND_CORE_SUFFIX="】内核!"
BOT_TG_SEND_BAK="请发送需要还原的备份文件,必须是【.tar.gz】格式"
BOT_TG_SEND_CFG="请发送需要上传的配置文件,必须是【"
BOT_TG_SEND_CFG_SUFFIX="】格式,支持自定义配置文件"
BOT_TG_SWITCH_TO="已切换到"
BOT_TG_ALREADY="当前已经是"
BOT_TG_ALREADY_PURE="当前已经是纯净模式!"
BOT_TG_SERVICE_RESTARTED_SHORT="🔄 服务已重启"
BOT_TG_LOG_CONTENT="📄 日志内容如下(已过滤任务日志)"
BOT_TG_TASK_WORD="任务"
BOT_TG_INPUT_SUB="✏ 请输入新的订阅链接:"
BOT_TG_SUB_UPDATED="订阅更新完成:"

View File

@@ -0,0 +1,3 @@
CHECK_PORT_RANGE_ERR="输入错误!请输入正确的数值(1-65535)"
CHECK_PORT_DUP_ERR="输入错误!请不要输入重复的端口!"
CHECK_PORT_OCCUPIED_ERR="当前端口已被其他进程占用,请重新输入!"

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

@@ -0,0 +1,35 @@
DDNS_WELCOME="欢迎使用DDNS"
DDNS_ADD_DONE="服务已经添加!"
DDNS_INPUT_DOMAIN="请输入你的域名"
DDNS_INPUT_USER="请输入用户名或邮箱"
DDNS_INPUT_PASS="请输入密码或令牌秘钥"
DDNS_INPUT_CHECK_INTERVAL="请输入检测更新间隔(单位:分钟默认为10)"
DDNS_INPUT_FORCE_INTERVAL="请输入强制更新间隔(单位:小时默认为24)"
DDNS_CONFIRM_INFO="请核对如下信息:"
DDNS_FIELD_SERVICE="服务商:"
DDNS_FIELD_DOMAIN="域名:"
DDNS_FIELD_USER="用户名:"
DDNS_FIELD_INTERVAL="检测间隔:"
DDNS_CONFIRM_ADD="是否确认添加:"
DDNS_YES="是"
DDNS_REINPUT="否,重新輸入"
DDNS_LIST_NOT_FOUND="未找到DDNS列表文件尝试在线获取……"
DDNS_DOWNLOAD_FAILED="下载失败,请重试!"
DDNS_SELECT_PROVIDER="请选择服务提供商:"
DDNS_INPUT_ERROR="输入错误,请重新输入!"
DDNS_SELECT_NETMODE="请选择网络模式:"
DDNS_IPV4="IPV4"
DDNS_IPV6="IPV6"
DDNS_DISABLE="停用"
DDNS_ENABLE="启用"
DDNS_UPDATE_NOW="立即更新"
DDNS_EDIT_CURRENT="编辑当前服务"
DDNS_CURRENT_SERVICE="当前服务"
DDNS_REMOVE_CURRENT="移除当前服务"
DDNS_VIEW_LOG="查看运行日志"
DDNS_NOT_SUPPORTED="本脚本依赖OpenWrt内置的DDNS服务,当前设备无法运行,已退出!"
DDNS_LIST_HEADER=" 列表 域名 启用 IP地址"
DDNS_ADD_SERVICE="添加DDNS服务"
DDNS_EXIT="退出"
DDNS_INPUT_INDEX="请输入对应序号"
DDNS_INPUT_NUM_ERROR="请输入正确数字!"

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优化"
@@ -50,3 +50,34 @@ DNS_IPV6_NOT_SUPPORT="该选项暂不支持IPv6加密DNS"
DNS_ENCRYPT_OK="已设置加密DNS如遇DNS解析问题请重置DNS配置" DNS_ENCRYPT_OK="已设置加密DNS如遇DNS解析问题请重置DNS配置"
DNS_CORE_REQUIRE="请使用Mihomo或SingBox内核" DNS_CORE_REQUIRE="请使用Mihomo或SingBox内核"
DNS_SET_TO="设为"
DNS_PROTECT_NOW="当前"
DNS_HOSTS_NOW="当前"
DNS_ENABLED="已启用"
DNS_DISABLED="已禁用"
DNS_PROTECT_DISABLE_Q="DNS防泄漏是否确认禁用"
DNS_PROTECT_ENABLE_Q="DNS防泄漏是否确认启用"
DNS_HOSTS_DISABLE_Q="Hosts优化是否确认禁用"
DNS_HOSTS_ENABLE_Q="Hosts优化是否确认启用"
DNS_YES="是"
DNS_RESET_DEFAULT="重置为默认值"
DNS_NO_BACK="否,返回上级菜单"
DNS_REMOVE_OK="移除成功"
DNS_REMOVE_FAIL="移除失败"
DNS_INPUT_REDIR_PORT="请直接输入旁路由IPV4地址"
DNS_INPUT_REDIR_RESET="或输入 r 重置DNS劫持端口"
DNS_INPUT_REDIR_BACK="或输入 0 返回上级菜单"
DNS_INPUT="请输入"
DNS_CONFIRM_ADD="请确认需要添加的地址:"
DNS_CONFIRM_OK="确认无误"
DNS_ADD_OK="添加成功"
DNS_ADD_FAIL="添加失败"
DNS_DIRECT_NOW="当前DIRECT-DNS"
DNS_PROXY_NOW="当前PROXY-DNS"
DNS_DEFAULT_NOW="当前DEFAULT-DNS"
DNS_INPUT_DIRECT_NEW="请直接输入新的DIRECT-DNS地址"
DNS_INPUT_DIRECT_RESET="或输入 r 重置DIRECT-DNS地址"
DNS_INPUT_PROXY_NEW="请直接输入新的PROXY-DNS地址"
DNS_INPUT_PROXY_RESET="或输入 r 重置PROXY-DNS地址"
DNS_INPUT_DEFAULT_NEW="请直接输入新的DEFAULT-DNS地址"
DNS_INPUT_DEFAULT_RESET="或输入 r 重置DEFAULT-DNS地址"

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,25 @@
PROVIDERS_MENU_GEN="生成包含全部提供者的配置文件"
PROVIDERS_MENU_TEMPLATE="选择\033[33m规则模版\033[0m"
PROVIDERS_MENU_CLEAN="\033[33m清理\033[0mproviders目录文件"
PROVIDERS_INPUT="请输入对应字母或数字"
PROVIDERS_EMPTY_HINT="你还未添加链接或本地配置文件,请先添加!"
PROVIDERS_TEMPLATE_CURRENT="当前规则模版为:"
PROVIDERS_TEMPLATE_SELECT="请选择在线模版:"
PROVIDERS_TEMPLATE_LOCAL="使用\033[36m本地模版\033[0m"
PROVIDERS_TEMPLATE_PATH="请输入模版的路径(绝对路径)"
PROVIDERS_TEMPLATE_NOT_FOUND="输入错误,找不到对应模版文件!"
PROVIDERS_CLEAN_WARN="将清空"
PROVIDERS_CLEAN_WARN_END="目录下所有内容"
PROVIDERS_CLEAN_CONFIRM="是否继续?"
PROVIDERS_FETCHING_TEMPLATE="正在获取在线模版......"
PROVIDERS_DOWNLOAD_FAILED="下载失败,请尝试更换安装源!"
PROVIDERS_GEN_OK="配置文件生成成功!"
PROVIDERS_GEN_OK_SINGBOX="配置文件生成成功如果启动超时建议更新里手动安装Singbox-srs数据库常用包"
PROVIDERS_GEN_FAILED="生成配置文件出错,请仔细检查输入!"
PROVIDERS_RESTART_ASK="是否立即启动/重启服务?"
PROVIDERS_YES="是"
PROVIDERS_NO="否"
PROVIDERS_CRON_SUB_UPDATE="更新订阅"

View File

@@ -0,0 +1,34 @@
SCD_SELECT_INSTALL_DIR="请选择安装目录:"
SCD_INPUT_NUM="请输入相应数字"
SCD_INPUT_ERROR="输入错误!请重新设置!"
SCD_XIAOMI_DETECTED="检测到当前设备为小米官方系统,请选择安装位置:"
SCD_CUSTOM_DIR_WARN="自定义目录(不推荐,不明勿用!)"
SCD_EXIT_INSTALL="退出安装"
SCD_SELECT_USB_DIR="请选择U盘目录"
SCD_ASUS_DM_NOT_FOUND="未找到下载大师自启文件:"
SCD_CHECK_SETTING="请检查设置!"
SCD_ASUS_DETECTED="检测到当前设备为华硕固件,请选择安装方式"
SCD_ASUS_INSTALL_DM="基于U盘+下载大师安装支持所有固件限ARM设备须插入U盘或移动硬盘"
SCD_ASUS_INSTALL_SCRIPT="基于自启脚本安装(仅持部分梅林固件)"
SCD_ASUS_DM_HINT="请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!"
SCD_ASUS_REINSTALL_HINT="如开机无法正常自启请重新使用U盘+下载大师安装!"
SCD_PATH_FORMAT_HINT="路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!"
SCD_PATH_FREE_SPACE="可用路径 剩余空间:"
SCD_INPUT_CUSTOM_DIR="请输入自定义路径"
SCD_PATH_ERROR="路径错误!请重新设置!"
SCD_INSTALL_SPACE_HINT="注意安装ShellCrash至少需要预留约1MB的磁盘空间"
SCD_INSTALL_ETC="在\033[32m/etc目录\033[0m下安装适合root用户"
SCD_INSTALL_USR="在\033[32m/usr/share目录\033[0m下安装适合Linux系统"
SCD_INSTALL_HOME="在\033[32m当前用户目录\033[0m下安装适合非root用户"
SCD_INSTALL_USB="在\033[32m外置存储\033[0m中安装"
SCD_INSTALL_MANUAL="手动设置安装目录"
SCD_INSTALL_CANCELED="安装已取消"
SCD_NO_WRITE_PREFIX="没有"
SCD_NO_WRITE_SUFFIX="目录写入权限!请重新设置!"
SCD_TARGET_DIR_PREFIX="目标目录"
SCD_TARGET_DIR_SPACE="空间剩余:"
SCD_CONFIRM_INSTALL="是否确认安装?"
SCD_YES="是"
SCD_NO="否"
SCD_DIR_FREE="目录,剩余空间:"
SCD_SOFT_SOLID="(支持软固化功能)"

View File

@@ -0,0 +1,52 @@
SETBOOT_NOT_SET="未设置"
SETBOOT_SECOND="秒"
SETBOOT_TITLE="启动设置菜单"
SETBOOT_ITEM_AUTO="开机自启动:"
SETBOOT_ITEM_OLD="使用保守模式:"
SETBOOT_ITEM_OLD_DESC="———基于定时任务(每分钟检测)"
SETBOOT_ITEM_DELAY="设置自启延时:"
SETBOOT_ITEM_DELAY_DESC="———用于解决自启后服务受限"
SETBOOT_ITEM_MINI="启用小闪存模式:"
SETBOOT_ITEM_MINI_DESC="———用于闪存空间不足的设备"
SETBOOT_ITEM_MINI_DIR="设置小闪存目录:"
SETBOOT_ITEM_NETCHK="自启网络检查:"
SETBOOT_ITEM_NETCHK_DESC="———禁用则跳过自启时网络检查"
SETBOOT_VIEW_LOG="查看启动日志"
SETBOOT_AUTO_OFF="已禁止ShellCrash开机自启动"
SETBOOT_AUTO_ON="已设置ShellCrash开机自启动"
SETBOOT_CRON_INIT="ShellCrash初始化"
SETBOOT_OLDMODE_ON="改为使用保守模式启动服务!"
SETBOOT_OLDMODE_OFF="改为使用系统守护进程启动服务!"
SETBOOT_MODE_UNSUPPORTED="当前设备不支持以其他模式启动!"
SETBOOT_DELAY_HINT1="如果你的设备启动后可以正常使用,则无需设置!"
SETBOOT_DELAY_HINT2="推荐设置为30120秒之间请根据设备问题自行试验"
SETBOOT_DELAY_INPUT="请输入启动延迟时间0300秒"
SETBOOT_SET_OK="设置成功!"
SETBOOT_DELAY_INVALID="输入有误或超过300秒请重新输入"
SETBOOT_MINI_NEEDED_NO="您的设备空间充足(>20M无需开启"
SETBOOT_SYSTEMD_WARN="不支持systemd启动模式请先启用保守模式"
SETBOOT_MINI_ENABLED="已经启用小闪存功能!"
SETBOOT_MINI_DIR_HINT="如需更换目录,请使用【设置小闪存目录】功能"
SETBOOT_MINI_DISABLE_WARN="您的设备剩余空间不足8M停用后可能无法正常运行"
SETBOOT_MINI_DISABLE_CONFIRM="是否确认停用此功能?"
SETBOOT_YES="是"
SETBOOT_NO_BACK="否,返回上级菜单"
SETBOOT_MINI_DISABLED="已经停用小闪存功能!"
SETBOOT_BINDIR_HINT1="如设置到内存,则每次开机后都自动重新下载相关文件"
SETBOOT_BINDIR_HINT2="请确保安装源可用裸连,否则会导致启动失败"
SETBOOT_BINDIR_TMP="使用内存(/tmp"
SETBOOT_BINDIR_USB="选择U盘目录"
SETBOOT_BINDIR_CUSTOM="自定义目录"
SETBOOT_SELECT_INSTALL_DIR="请选择安装目录:"
SETBOOT_SPACE_USED="已占用的储存空间:"
SETBOOT_INPUT_ERROR="输入错误!请重新设置!"
SETBOOT_INPUT_CMD="请直接输入命令语句"
SETBOOT_INPUT_OR_BACK="或输入 0 返回上级菜单"
SETBOOT_INPUT="请输入"
SETBOOT_NETCHK_HINT1="如果你的设备启动后可以正常使用,则无需变更设置!"
SETBOOT_NETCHK_HINT2="禁用时如果使用了小闪存模式或者rule-set等在线规则则可能会因无法联网而导致启动失败"
SETBOOT_NETCHK_HINT3="启用时,会导致部分性能较差或者拨号较慢的设备可能会因查询超时导致启动失败!"
SETBOOT_NETCHK_OFF_CONFIRM="当前\033[33m已禁用\033[0m自启网络检查是否确认启用"
SETBOOT_NETCHK_ON_CONFIRM="当前\033[33m已启用\033[0m自启网络检查是否确认禁用"
SETBOOT_TASK_WORD="任务"
SETBOOT_LOG_NOT_FOUND="未找到相关日志!"

View File

@@ -0,0 +1,33 @@
SUBCONVERTER_MENU_GEN="生成包含全部节点、订阅的配置文件"
SUBCONVERTER_MENU_EXCLUDE="设置\033[31m排除节点正则\033[0m"
SUBCONVERTER_MENU_INCLUDE="设置\033[32m包含节点正则\033[0m"
SUBCONVERTER_MENU_RULE="选择\033[33m在线规则模版\033[0m"
SUBCONVERTER_MENU_SERVER="选择Subconverter服务器"
SUBCONVERTER_MENU_UA="自定义浏览器UA"
SUBCONVERTER_INPUT="请输入"
SUBCONVERTER_BACK="或输入 0 返回上级菜单"
SUBCONVERTER_EXCLUDE_HINT1="匹配关键字的节点会在导入时被【屏蔽】!"
SUBCONVERTER_INCLUDE_HINT1="仅有匹配关键字的节点才会被【导入】!!!"
SUBCONVERTER_KEYWORD_SPLIT="多个关键字可以用\033[30;47m | \033[0m号分隔"
SUBCONVERTER_REGEX_HINT="\033[32m支持正则表达式\033[0m空格请使用\033[30;47m + \033[0m号替代"
SUBCONVERTER_EXCLUDE_INPUT="请直接输入节点过滤关键字"
SUBCONVERTER_INCLUDE_INPUT="请直接输入节点匹配关键字"
SUBCONVERTER_EXCLUDE_CLEAR="或输入 d \033[31m清空\033[0m节点过滤关键字"
SUBCONVERTER_INCLUDE_CLEAR="或输入 d \033[31m清空\033[0m节点匹配关键字"
SUBCONVERTER_RULE_CURRENT="当前使用规则为:"
SUBCONVERTER_SERVER_HINT="以下为互联网采集的第三方服务器,具体安全性请自行斟酌!"
SUBCONVERTER_SERVER_THANKS="感谢以下作者的无私奉献!!!"
SUBCONVERTER_SERVER_CURRENT="当前使用后端为:"
SUBCONVERTER_SET_OK="设置成功!返回上级菜单"
SUBCONVERTER_UA_HINT="无法正确获取配置文件时可尝试使用"
SUBCONVERTER_UA_CURRENT="当前UA"
SUBCONVERTER_UA_AUTO="使用自动UA默认"
SUBCONVERTER_UA_NONE="不使用UA"
SUBCONVERTER_UA_CUSTOM="使用自定义UA"
SUBCONVERTER_UA_CLEAR="清空UA"
SUBCONVERTER_UA_CUSTOM_WARN="注意:\n自定义UA不可包含空格或特殊符号"
SUBCONVERTER_UA_CUSTOM_INPUT="请直接输入自定义UA"

View File

@@ -0,0 +1,19 @@
TASK_CMD_EVERY="每隔"
TASK_CMD_HOURLY="时每"
TASK_CMD_MIN="分钟"
TASK_CMD_CORE_SKIP="任务【自动更新内核】中止-未检测到版本更新"
TASK_CMD_CORE_DONE="任务【自动更新内核】下载完成,正在重启服务!"
TASK_CMD_CORE_DL_FAIL="任务【自动更新内核】出错-下载失败!"
TASK_CMD_CORE_VERIFY_FAIL="任务【自动更新内核】出错-内核校验失败!"
TASK_CMD_SCRIPT_SKIP="任务【自动更新脚本】中止-未检测到版本更新"
TASK_CMD_SCRIPT_UNZIP_FAIL="任务【自动更新脚本】出错-解压失败!"
TASK_CMD_DB_SKIP_PREFIX="任务【自动更新数据库文件】跳过-未检测到"
TASK_CMD_DB_SKIP_SUFFIX="版本更新"
TASK_CMD_DB_DL_FAIL_PREFIX="任务【自动更新数据库文件】更新【"
TASK_CMD_DB_DL_FAIL_SUFFIX="】下载失败!"
TASK_CMD_DB_OK_PREFIX="任务【自动更新数据库文件】更新【"
TASK_CMD_DB_OK_SUFFIX="】成功!"
TASK_CMD_RES_OK="成功"
TASK_CMD_RES_FAIL="失败"
TASK_CMD_EXEC_PREFIX="任务【"
TASK_CMD_EXEC_MID="】执行"

View File

@@ -0,0 +1,13 @@
UNINSTALL_WARN="警告:该操作不可逆!"
UNINSTALL_CONFIRM="是否确认卸载ShellCrash"
UNINSTALL_YES="是"
UNINSTALL_NO="否"
UNINSTALL_KEEP_CONFIRM="是否保留脚本配置及订阅文件?"
UNINSTALL_ENV_ERROR="环境变量配置有误,请尝试手动移除安装目录!"
UNINSTALL_DONE="已卸载ShellCrash相关文件有缘再会"
UNINSTALL_CLOSE_HINT="请手动关闭当前窗口以重置环境变量!"
UNINSTALL_CANCELED="操作已取消!"
UNINSTALL_CRON_CLASH="clash服务"
UNINSTALL_CRON_SUB="订阅链接"
UNINSTALL_CRON_INIT="ShellCrash初始化"
UNINSTALL_SSH_MARK="启用外网访问SSH服务"

View File

@@ -0,0 +1,17 @@
# 新手引导
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="很好!现在只需要执行启动就可以愉快的使用了!"
UG_IMPORT_NOW="立即导入"
UG_IMPORT_LATER="暂不导入"

View File

@@ -126,3 +126,33 @@ ADV_TABLE_INPUT="Please enter the routing table ID (do not modify unless necessa
# ================================================= # =================================================
IPV6_REDIR="IPv6 Transparent Routing (Hijack IPv6 Traffic)" IPV6_REDIR="IPv6 Transparent Routing (Hijack IPv6 Traffic)"
IPV6_DNS="IPv6 DNS Resolution (Return IPv6 addresses)" IPV6_DNS="IPv6 DNS Resolution (Return IPv6 addresses)"
SET_YES="Yes"
SET_NO_BACK="No, back"
SET_SKIP_CERT_NOW="Current status: "
SET_ENABLED="enabled"
SET_DISABLED="disabled"
SET_SKIP_CERT_ENABLE_Q=" skip local certificate verification. Enable now?"
SET_SKIP_CERT_DISABLE_Q=" skip local certificate verification. Disable now?"
SET_SNIFFER_NOW="Current status: "
SET_SNIFFER_ENABLE_Q=" domain sniffer. Enable now?"
SET_SNIFFER_DISABLE_Q=" domain sniffer. Disable now?"
SET_LANG_ZH="简体中文"
SET_LANG_EN="English"
SET_SWITCH_RERUN="Switched successfully! Please re-run the script!"
SET_SWITCH_OK="Switched successfully!"
SET_MODE_SUFFIX="mode"
SET_SET_TO="Set to "
SET_BYPASS_TCP="TCP bypass forwarding"
SET_BYPASS_TU="TCP&UDP bypass forwarding"
SET_BYPASS_TCP_DESC="forward TCP traffic only to bypass router"
SET_BYPASS_TU_DESC="forward TCP&UDP traffic to bypass router"
SET_FW_AREA_CURRENT="Current hijack scope: "
SET_WARN="Notice:"
SET_DESC="Description:"
SET_BYPASS_WARN_1="This feature has risks. Do not use without network knowledge!"
SET_BYPASS_WARN_2="For UDP proxy, ensure bypass router runs a UDP-capable mode!"
SET_BYPASS_WARN_3="With systemd startup, core still runs idle. Conservative mode is recommended!"
SET_BYPASS_DESC_1="This mode does not start core; it only configures firewall forwarding and downstream devices need no extra gateway/DNS setup"
SET_BYPASS_DESC_2="Supports firewall routing split and device filtering, supports some cron tasks, but not IPv6"
SET_INPUT_BYPASS_IPV4="Please enter bypass-router IPv4 address"
SET_TIPS_ENTER_BACK="Tip: press Enter directly to return"

100
scripts/lang/en/5_task.lang Normal file
View File

@@ -0,0 +1,100 @@
# 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"
TASK5_RUN_TASK=" run task: "
TASK5_CONFIRM_ADD_CRON="Confirm adding scheduled task?"
TASK5_YES="Yes"
TASK5_NO="No"
TASK5_TASK_PREFIX="Task ["
TASK5_TASK_ADDED="] \033[32madded!\033[0m"
TASK5_USER_ADD_HINT1="Command may contain spaces, please ensure it is executable!"
TASK5_USER_ADD_HINT2="Do not append conditions. Set conditions after adding command."
TASK5_USER_ADD_HINT3="You can also edit "
TASK5_USER_ADD_HINT4=" manually to add commands"
TASK5_INPUT_CMD="Please input command directly"
TASK5_OR_BACK="Or input 0 to return"
TASK5_INPUT="Please enter"
TASK5_CHECK_INPUT="Please check input: "
TASK5_INPUT_REMARK="Please enter task remark"
TASK5_CUSTOM_TASK="custom_task_"
TASK5_CUSTOM_ADDED="Custom task added!"
TASK5_INPUT_ERROR="Invalid input, please retry!"
TASK5_USER_DEL_HINT1="Input ID to remove custom task (built-in tasks won't be affected)"
TASK5_USER_DEL_HINT2="You may also edit "
TASK5_NO_CUSTOM_TASK="No custom task has been added yet"
TASK5_SELECT_ADD="Please select task to add:"
TASK5_SELECT_COND="Select execution condition for task "
TASK5_SELECT_COND2=":"
TASK5_COND_1="Scheduled task \033[32mweekly\033[0m"
TASK5_COND_2="Scheduled task \033[32mdaily\033[0m"
TASK5_COND_3="Scheduled task \033[32mhourly\033[0m"
TASK5_COND_4="Scheduled task \033[32mminutely\033[0m"
TASK5_WARN_LINE1=" --------- \033[31mWARNING\033[0m ---------"
TASK5_WARN_LINE2=" Do not use advanced triggers unless you know what you are doing!"
TASK5_WARN_LINE3=" ----------------------------------------"
TASK5_COND_5="Service \033[33mbefore start\033[0m"
TASK5_COND_6="Service \033[33mafter start\033[0m"
TASK5_COND_7="Service \033[33mrun every minute\033[0m"
TASK5_COND_8="After firewall service \033[33mrestart\033[0m"
TASK5_WEEK_HINT1="Input 1~7 for day of week (7=Sunday)"
TASK5_WEEK_HINT2="Input like 1,4,0 for Monday/Thursday/Sunday"
TASK5_WEEK_HINT3="Input 1~5 for Monday to Friday"
TASK5_WEEK_INPUT="Run on which weekday"
TASK5_HOUR_INPUT1="Run at which hour of that day (0~23)"
TASK5_CRON_WEEK="Weekly "
TASK5_CRON_WEEK2=" @ "
TASK5_OCLOCK=":00"
TASK5_DAY_HINT1="Input 1,7,15 for run at 1/7/15 o'clock"
TASK5_DAY_HINT2="Input 6~18 for every hour between 6 and 18"
TASK5_HOUR_INPUT2="Run at which hour daily (0~23)"
TASK5_MIN_INPUT="Run at which minute (0~59)"
TASK5_CRON_DAY="Daily "
TASK5_POINT=":"
TASK5_MINUTE=""
TASK5_EVERY_HOUR_INPUT="Run every how many hours (1~23)"
TASK5_EVERY="Every "
TASK5_HOUR=" hour(s)"
TASK5_EVERY_MIN_INPUT="Run every how many minutes (1~59)"
TASK5_MIN=" minute(s)"
TASK5_BFSTART="Before service start "
TASK5_AFSTART="After service start "
TASK5_RUNNING_HINT1="Input 10 for every 10 mins, 1440 for every 24 hrs"
TASK5_RUNNING_HINT2="Values >60 mins will be rounded by hour under current timezone"
TASK5_RUNNING_INPUT="Run every how many minutes (1~1440)"
TASK5_RUNNING_PREFIX="During runtime every "
TASK5_AFFW_HINT="This will inject startup code into /etc/init.d/firewall"
TASK5_CONFIRM_CONTINUE="Continue?"
TASK5_AFFW_PREFIX="After firewall restart "
TASK5_GUARD_WORD="guard"
TASK5_OLD_PREFIX="legacy-"
TASK5_NONE_TO_MANAGE="No task available to manage!"
TASK5_ADDED_TASKS="Added tasks:"
TASK5_CLEAR_OLD="Clear legacy tasks"
TASK5_CLEAR_ALL="Clear task list"
TASK5_OLD_CLEARED="Legacy tasks cleared!"
TASK5_ALL_CLEARED="All tasks cleared!"
TASK5_OLD_NOT_SUPPORT="Legacy tasks cannot be managed, remove them?"
TASK5_NO_BACK="No, return"
TASK5_CURRENT_TASK="Current task: "
TASK5_EDIT_TASK="\033[33mEdit\033[0m current task"
TASK5_DEL_TASK="\033[31mDelete\033[0m current task"
TASK5_RUN_ONCE="\033[32mRun once\033[0m now"
TASK5_VIEW_RECORD="View \033[33mexecution record\033[0m"
TASK5_RUN_OK="success!"
TASK5_RUN_FAIL="failed!"
TASK5_RECORD_NOT_FOUND="No execution record found!"
TASK5_USER_FILE_HEADER="#task_id(>200 in order)#task_command#task_desc(no # in cmd or desc)"
TASK5_MENU_TITLE="Scheduled Tasks"
TASK5_MENU_1="Add \033[32mautomatic task\033[0m"
TASK5_MENU_2="Manage \033[33mtask list\033[0m"
TASK5_MENU_3="View \033[36mtask logs\033[0m"
TASK5_MENU_4="Configure \033[36mlog push\033[0m"
TASK5_MENU_5="Add \033[33mcustom task\033[0m"
TASK5_MENU_6="Delete \033[33mcustom task\033[0m"
TASK5_MENU_7="Use \033[32mrecommended settings\033[0m"
TASK5_TASK_GREP="Task ["
TASK5_LOG_NOT_FOUND="No task-related log found!"
TASK5_PUSH_HINT="Please configure push channel and switch in log tools"

View File

@@ -0,0 +1,67 @@
CORECFG_TITLE="Configuration Management"
CORECFG_HINT_SELECT_PROVIDER="Input a number to manage corresponding provider"
CORECFG_MENU_A="\033[32mAdd provider\033[0m (subscription/share link/local file)"
CORECFG_MENU_B="\033[36mGenerate local config\033[0m"
CORECFG_MENU_C="\033[33mGenerate online config\033[0m"
CORECFG_MENU_D="\033[31mClear provider list\033[0m"
CORECFG_MENU_E="\033[36mCustom config file\033[0m"
CORECFG_CORE_ONLY="Only for Mihomo/singboxr core, please switch core!"
CORECFG_ADD_PROVIDER_FIRST="Please add provider first!"
CORECFG_CLEAR_WARN="Warning: this will delete all providers and cannot be undone!"
CORECFG_CLEAR_CONFIRM="Confirm clearing provider list:"
CORECFG_YES="Yes"
CORECFG_NO="No"
CORECFG_NO_BACK="No, return"
CORECFG_INPUT_ALNUM="Please input letter or number"
CORECFG_INPUT="Please enter"
CORECFG_FILL_REQUIRED="Please complete required fields first!"
CORECFG_START_APPLY="Start service to apply config now?"
CORECFG_PROVIDER_SUPPORT="Supports adding subscription/share link/local file as provider"
CORECFG_SET_NAME="Set \033[36mname/alias\033[0m\t"
CORECFG_SET_LINK="Set \033[32mlink/path\033[0m:\t"
CORECFG_SET_OVERRIDE="Set \033[33mlocal generation override\033[0m"
CORECFG_SAVE_PROVIDER="\033[36mSave this provider\033[0m"
CORECFG_DEL_PROVIDER="\033[31mDelete this provider\033[0m"
CORECFG_MORE_CONFIG_HINT="For detailed settings below, go to corresponding feature page."
CORECFG_GEN_LOCAL_ONE="\033[32mLocal generate\033[0m config with this provider only"
CORECFG_GEN_ONLINE_ONE="\033[33mOnline generate\033[0m config with this provider only"
CORECFG_GET_ONLINE_DIRECT="Fetch this config online directly (without conversion)"
CORECFG_USE_DIRECT="Use this file directly as config (without local generation)"
CORECFG_NAME_HINT="Note:\nName/alias cannot duplicate, cannot be pure digits, and should not be too long!"
CORECFG_INPUT_NAME="Please input name/alias"
CORECFG_OR_BACK="or input 0 to return"
CORECFG_LINK_HINT1="\033[33mSubscription link\033[0m:\nClash config subscription URL starting with https/http"
CORECFG_LINK_HINT2="\033[36mShare link\033[0m:"
CORECFG_LINK_HINT3="\033[33mLocal file\033[0m:\nMust be placed under "
CORECFG_LINK_HINT4=""
CORECFG_LINK_HINT5="\033[36mBase64 \033[0m:\nPlease write to local file directly"
CORECFG_INPUT0_BACK="Input 0 to return"
CORECFG_SELECT_FILE_OR_LINK="Select file or input link"
CORECFG_INPUT_LINK="Please input link directly"
CORECFG_DANGER1="Warning:\nThis feature is incompatible with skip certificate verification"
CORECFG_DANGER2="Please make sure you fully understand what you are doing"
CORECFG_DANGER_CONFIRM="I confirm I can troubleshoot by myself"
CORECFG_INTERVAL1="Set \033[33mhealth-check interval\033[0m:\t"
CORECFG_INTERVAL2="Set \033[36mauto-update interval\033[0m:\t"
CORECFG_MIN="min"
CORECFG_HOUR="hour"
CORECFG_SET_UA="Set \033[33mbrowser UA\033[0m:\t"
CORECFG_SET_EXCLUDE="Set \033[31mexclude regex\033[0m:\t"
CORECFG_SET_INCLUDE="Set \033[32minclude regex\033[0m:\t"
CORECFG_CUR_INTERVAL="Current health-check interval:"
CORECFG_INPUT_INTERVAL1="Input health-check interval (minutes)"
CORECFG_RESET_INTERVAL1="or input r to reset to default (3 min)"
CORECFG_INPUT_INTERVAL2="Input auto-update interval (hours)"
CORECFG_RESET_INTERVAL2="or input r to reset to default (12 hours)"
CORECFG_CUR_UA_NONE="Current browser UA: none"
CORECFG_CUR_UA="Current browser UA: "
CORECFG_INPUT_UA="Input browser UA"
CORECFG_RESET_UA="or input r to reset UA to default (clash.meta)"
CORECFG_CUR_EXCLUDE_NONE="Current exclude rule: none"
CORECFG_CUR_EXCLUDE="Current exclude rule: "
CORECFG_INPUT_EXCLUDE="Input exclude keyword(s) (regex supported, no spaces)"
CORECFG_CLEAR_EXCLUDE="or input c to clear exclude rule"
CORECFG_CUR_INCLUDE_NONE="Current include rule: none"
CORECFG_CUR_INCLUDE="Current include rule: "
CORECFG_INPUT_INCLUDE="Input include keyword(s) (regex supported, no spaces)"
CORECFG_CLEAR_INCLUDE="or input c to clear include rule"

View File

@@ -0,0 +1,16 @@
GW_TITLE="Access & Control Menu"
GW_WARN="Notice: "
GW_FW_VPS_HINT="If running on a VPS, also allow related ports in your VPS security policy."
GW_FW_PORT_LIMIT="Up to 10 allowed ports are supported. Please remove some first."
GW_INPUT_ALLOW_PORT="Enter the port to allow"
GW_OK="Done"
GW_CORE_UNSUPPORTED=" core does not support this feature yet, please switch core first!"
GW_TG_DONE_PREFIX="Telegram bot setup completed! Use"
GW_TG_DONE_SUFFIX="to open the function menu!"
GW_SET="Configured"
GW_BOUND="Bound"
GW_INPUT_PORT_DEL0="Enter port (0 to delete)"
GW_INPUT_WSPATH="Enter ws-path (0 to delete)"
GW_INPUT_UUID="Enter UUID (0 to delete)"
GW_INPUT_HOST="Enter your public IP (v4/v6) or domain"
GW_SHARE_LINK_HINT="Your share link (do not share casually):"

View File

@@ -0,0 +1,11 @@
TOOLS_TITLE="Tools & Optimization"
TOOLS_SSH_DISABLE="Disable"
TOOLS_SSH_ENABLE="Enable"
TOOLS_ERR_PORT="Invalid input! Please enter a valid number (1000-65535)!"
TOOLS_ERR_PORT_OCCUPIED="This port is occupied by another process, please try another one!"
TOOLS_SSH_SET_OK="Set successfully, please re-enable WAN SSH access!"
TOOLS_SSH_ENABLED="WAN SSH access enabled!"
TOOLS_SSH_DISABLED="WAN SSH access disabled!"
TOOLS_DISABLE="Disable"
TOOLS_ENABLE="Enable"
TOOLS_CONFIGURED="Configured"

View File

@@ -0,0 +1,49 @@
UPG_ERR_TRY_OTHER_SOURCE="Please switch to another source and try downloading again!"
UPG_ERR_LOCAL_INSTALL="Or refer to \033[32;4mhttps://juewuy.github.io/bdaz\033[0m for local installation!"
UPG_TITLE="Update & Support"
UPG_CUR_DIR_SPACE="Current directory"
UPG_LOW_SPACE_HINT="Low free space in current directory, consider enabling low-flash mode!"
UPG_MENU_SCRIPT="Update "
UPG_MENU_SCRIPT_NAME="script"
UPG_MENU_CORE="Switch/Update "
UPG_MENU_CORE_NAME="core"
UPG_MENU_GEO="Install/Update local "
UPG_MENU_GEO_NAME="database files"
UPG_MENU_DB="Install/Update local "
UPG_MENU_DB_NAME="Dashboard"
UPG_MENU_CRT="Install/Update local "
UPG_MENU_CRT_NAME="certificates"
UPG_MENU_PAC=" proxy view"
UPG_MENU_SOURCE="Switch "
UPG_MENU_SOURCE_NAME="source and branch"
UPG_MENU_UNINSTALL="Uninstall ShellCrash"
UPG_MENU_THANKS="Thanks list"
UPG_PAC_LINK="PAC URL: "
UPG_PAC_GUIDE="PAC guide: "
UPG_THANKS_TITLE="Thanks to the following projects and developers!"
UPG_THANKS_SPECIAL="Special thanks: \033[36mall contributors and sponsors!\033[0m"
UPG_CHECKING="Checking updates..."
UPG_CHECK_OK="Update check succeeded"
UPG_CHECK_FAIL="Update check failed! Please switch source and retry!"
UPG_DOWNLOAD_FAIL="Download failed!"
UPG_EXTRACTING="Extracting files..."
UPG_EXTRACT_FAIL="Extraction failed!"
UPG_SCRIPT_OK="Script update succeeded!"
UPG_SCRIPT_WARN="Note: service will be stopped during update!"
UPG_SCRIPT_CUR_VER="Current script version: "
UPG_SCRIPT_NEW_VER="Latest script version: "
UPG_UPDATE_NOW="Update now"
UPG_SCRIPT_MGR_OK="Manager script updated successfully!"
UPG_CPUCORE_HINT1="Use only when CPU architecture detection fails or core cannot run!"
UPG_CPUCORE_HINT2="Not sure how to get core arch?"
UPG_CPUCORE_HINT3="Refer to: "
UPG_CPUCORE_LIST="Available online CPU architectures:"
UPG_CPUCORE_ERR="Please enter a valid CPU architecture!"
UPG_CORETYPE_CONFIRM="Please confirm custom core type:"
UPG_CORE_SWITCH_PREFIX="Switched from "
UPG_CORE_SWITCH_MID=" to "
UPG_CORE_SWITCH_SUFFIX=" core"
UPG_CORE_SWITCH_WARN="Geo DB and yaml/json configs are not compatible between the two cores"
UPG_CORE_SWITCH_KEEP="Keep related database files?"
UPG_KEEP="Keep"
UPG_NOT_KEEP="Do not keep"

View File

@@ -0,0 +1,68 @@
BOT_TG_PRIVATE_HINT="Please apply for a Telegram bot via \033[32;4mhttps://t.me/BotFather\033[0m and get its \033[36mAPI TOKEN\033[0m first"
BOT_TG_INPUT_TOKEN="Please enter your API TOKEN"
BOT_TG_PRIVATE_TOP="Please send to \033[32myour bot\033[33m, NOT BotFather!\033[0m"
BOT_TG_PUBLIC_HINT="Please message the bot: \033[32;4mhttps://t.me/ShellCrashtg_bot\033[0m"
BOT_TG_SET_DONE="Telegram log push has been configured!"
BOT_TG_CHATID_RETRY_PREFIX="Attempt"
BOT_TG_CHATID_RETRY_SUFFIX="to get chat ID failed, retrying..."
BOT_TG_SEND_KEY="Send this key:"
BOT_TG_SENT_CONFIRM="I have sent it"
BOT_TG_CHATID_FAIL="Unable to get chat ID. Please reconfigure or input ChatID manually!"
BOT_TG_CHATID_MANUAL_HINT="Usually visit"
BOT_TG_CHATID_MANUAL_HINT2="to find ChatID"
BOT_TG_INPUT_CHATID="Please input ChatID manually"
BOT_TG_CHATID_RECONFIG="Unable to get chat ID. Please reconfigure!"
BOT_TG_CRON_NAME="TG_BOT watchdog"
BOT_TG_HELP_GROUP="Group chat:"
BOT_TG_HELP_PROJECT="Project:"
BOT_TG_HELP_GUIDE="Guide:"
BOT_TG_HELP_COFFEE="Buy me a coffee:"
BOT_TG_HELP_AIRPORT="Partner provider:"
BOT_TG_RUN_ON="🟢Running"
BOT_TG_RUN_OFF="🟡Stopped"
BOT_TG_WELCOME="Welcome to ShellCrash!"
BOT_TG_SERVICE=" service "
BOT_TG_MEM_USED="Memory usage: "
BOT_TG_RUNNING_TIME="Running: "
BOT_TG_SELECT_ACTION="Please choose:"
BOT_TG_SELECT_FILE="Please choose file upload/download action:"
BOT_TG_BTN_START="✈️ Enable redirect"
BOT_TG_BTN_PURE="💧 Pure mode"
BOT_TG_BTN_RESTART="🕹 Restart service"
BOT_TG_BTN_LOG="📄 View logs"
BOT_TG_BTN_TRANSFER="🔃 File transfer"
BOT_TG_BTN_GET_LOG="📥 Download log"
BOT_TG_BTN_GET_BAK="💾 Backup settings"
BOT_TG_BTN_GET_CFG="⬇️ Download config"
BOT_TG_BTN_UP_CORE="🪐 Upload core"
BOT_TG_BTN_UP_BAK="🔄 Restore settings"
BOT_TG_BTN_UP_CFG="⬆️ Upload config"
BOT_TG_NO_CURL="⚠️ curl is missing on this device, only upload is supported!"
BOT_TG_UPLOAD_OK="success! Service will restart soon!"
BOT_TG_UPLOAD_FAIL="failed, please check file and retry!"
BOT_TG_CORE_UPDATE="Core update "
BOT_TG_CFG_RESTORED="Config restored, please restart service manually!"
BOT_TG_RESTORE_FAIL="Restore failed while extracting backup, please retry!"
BOT_TG_CFG_UPLOADED="Config uploaded, please restart service manually!"
BOT_TG_UPLOAD_FAIL2="Upload failed, please retry!"
BOT_TG_NET_UPLOAD_FAIL="Network error, upload failed! Please retry!"
BOT_TG_FILE_FORMAT_FAIL="File format mismatch, upload failed!"
BOT_TG_FW_ENABLED="ShellCrash redirect mode "
BOT_TG_FW_ENABLED_SUFFIX=" enabled!"
BOT_TG_SWITCH_PURE="Switched to pure mode!"
BOT_TG_SERVICE_RESTARTED="ShellCrash service restarted!"
BOT_TG_UNFINISHED="Error: unfinished feature!"
BOT_TG_SEND_CORE="Please send core file ending with tar.gz/.gz/.upx for ["
BOT_TG_SEND_CORE_SUFFIX="]"
BOT_TG_SEND_BAK="Please send backup file in [.tar.gz] format!"
BOT_TG_SEND_CFG="Please send config file in ["
BOT_TG_SEND_CFG_SUFFIX="] format, custom config is supported"
BOT_TG_SWITCH_TO="Switched to "
BOT_TG_ALREADY="Already in "
BOT_TG_ALREADY_PURE="Already in pure mode!"
BOT_TG_SERVICE_RESTARTED_SHORT="🔄 Service restarted"
BOT_TG_LOG_CONTENT="📄 Logs (task logs filtered):"
BOT_TG_TASK_WORD="Task"
BOT_TG_INPUT_SUB="✏ Please enter new subscription URL:"
BOT_TG_SUB_UPDATED="Subscription update finished:"

View File

@@ -0,0 +1,3 @@
CHECK_PORT_RANGE_ERR="Invalid input! Please enter a valid value (1-65535)!"
CHECK_PORT_DUP_ERR="Invalid input! Please do not enter duplicate ports!"
CHECK_PORT_OCCUPIED_ERR="This port is already occupied by another process. Please enter a different one!"

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!"

35
scripts/lang/en/ddns.lang Normal file
View File

@@ -0,0 +1,35 @@
DDNS_WELCOME="Welcome to DDNS!"
DDNS_ADD_DONE="Service has been added!"
DDNS_INPUT_DOMAIN="Please enter your domain"
DDNS_INPUT_USER="Please enter username or email"
DDNS_INPUT_PASS="Please enter password or token"
DDNS_INPUT_CHECK_INTERVAL="Please enter check interval (minutes, default 10)"
DDNS_INPUT_FORCE_INTERVAL="Please enter force update interval (hours, default 24)"
DDNS_CONFIRM_INFO="Please confirm the following info:"
DDNS_FIELD_SERVICE="Provider:"
DDNS_FIELD_DOMAIN="Domain:"
DDNS_FIELD_USER="Username:"
DDNS_FIELD_INTERVAL="Check interval:"
DDNS_CONFIRM_ADD="Confirm add:"
DDNS_YES="Yes"
DDNS_REINPUT="No, re-enter"
DDNS_LIST_NOT_FOUND="DDNS list file not found, trying online update..."
DDNS_DOWNLOAD_FAILED="Download failed, please retry!"
DDNS_SELECT_PROVIDER="Please select provider:"
DDNS_INPUT_ERROR="Invalid input, please retry!"
DDNS_SELECT_NETMODE="Please select network mode:"
DDNS_IPV4="IPV4"
DDNS_IPV6="IPV6"
DDNS_DISABLE="Disable"
DDNS_ENABLE="Enable"
DDNS_UPDATE_NOW="Update now"
DDNS_EDIT_CURRENT="Edit current service"
DDNS_CURRENT_SERVICE=" current service"
DDNS_REMOVE_CURRENT="Remove current service"
DDNS_VIEW_LOG="View logs"
DDNS_NOT_SUPPORTED="This feature depends on OpenWrt built-in DDNS service; unsupported on current device."
DDNS_LIST_HEADER=" List Domain On IP Address"
DDNS_ADD_SERVICE="Add DDNS service"
DDNS_EXIT="Exit"
DDNS_INPUT_INDEX="Please enter index"
DDNS_INPUT_NUM_ERROR="Please enter a valid number!"

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"
@@ -52,3 +52,34 @@ DNS_IPV6_NOT_SUPPORT="This option does not support IPv6 encrypted DNS!"
DNS_ENCRYPT_OK="Encrypted DNS has been configured. If DNS issues occur, please reset DNS settings." DNS_ENCRYPT_OK="Encrypted DNS has been configured. If DNS issues occur, please reset DNS settings."
DNS_CORE_REQUIRE="Please use the Mihomo or SingBox core" DNS_CORE_REQUIRE="Please use the Mihomo or SingBox core"
DNS_SET_TO="Set to"
DNS_PROTECT_NOW="Current status: "
DNS_HOSTS_NOW="Current status: "
DNS_ENABLED="enabled"
DNS_DISABLED="disabled"
DNS_PROTECT_DISABLE_Q=" DNS leak protection. Disable now?"
DNS_PROTECT_ENABLE_Q=" DNS leak protection. Enable now?"
DNS_HOSTS_DISABLE_Q=" Hosts optimization. Disable now?"
DNS_HOSTS_ENABLE_Q=" Hosts optimization. Enable now?"
DNS_YES="Yes"
DNS_RESET_DEFAULT="Reset to defaults"
DNS_NO_BACK="No, back"
DNS_REMOVE_OK="Removed successfully"
DNS_REMOVE_FAIL="Remove failed"
DNS_INPUT_REDIR_PORT="Please input bypass-router IPv4 address"
DNS_INPUT_REDIR_RESET="or input r to reset DNS redirect port"
DNS_INPUT_REDIR_BACK="or input 0 to go back"
DNS_INPUT="Please enter"
DNS_CONFIRM_ADD="Please confirm the address to add: "
DNS_CONFIRM_OK="Confirm"
DNS_ADD_OK="Added successfully"
DNS_ADD_FAIL="Add failed"
DNS_DIRECT_NOW="Current DIRECT-DNS: "
DNS_PROXY_NOW="Current PROXY-DNS: "
DNS_DEFAULT_NOW="Current DEFAULT-DNS: "
DNS_INPUT_DIRECT_NEW="Please input new DIRECT-DNS"
DNS_INPUT_DIRECT_RESET="or input r to reset DIRECT-DNS"
DNS_INPUT_PROXY_NEW="Please input new PROXY-DNS"
DNS_INPUT_PROXY_RESET="or input r to reset PROXY-DNS"
DNS_INPUT_DEFAULT_NEW="Please input new DEFAULT-DNS"
DNS_INPUT_DEFAULT_RESET="or input r to reset DEFAULT-DNS"

View File

@@ -0,0 +1,25 @@
PROVIDERS_MENU_GEN="Generate config including all providers"
PROVIDERS_MENU_TEMPLATE="Select \033[33mrule template\033[0m"
PROVIDERS_MENU_CLEAN="\033[33mClean\033[0m providers directory"
PROVIDERS_INPUT="Please enter a letter or number"
PROVIDERS_EMPTY_HINT="No link or local config file has been added yet. Please add one first!"
PROVIDERS_TEMPLATE_CURRENT="Current rule template: "
PROVIDERS_TEMPLATE_SELECT="Please select an online template:"
PROVIDERS_TEMPLATE_LOCAL="Use \033[36mlocal template\033[0m"
PROVIDERS_TEMPLATE_PATH="Please enter template path (absolute path)"
PROVIDERS_TEMPLATE_NOT_FOUND="Invalid input, template file not found!"
PROVIDERS_CLEAN_WARN="This will clear all files under"
PROVIDERS_CLEAN_WARN_END=""
PROVIDERS_CLEAN_CONFIRM="Continue?"
PROVIDERS_FETCHING_TEMPLATE="Fetching online template..."
PROVIDERS_DOWNLOAD_FAILED="Download failed. Please try switching install source!"
PROVIDERS_GEN_OK="Configuration file generated successfully!"
PROVIDERS_GEN_OK_SINGBOX="Configuration generated successfully! If startup times out, install the Singbox-srs common database package from Update menu."
PROVIDERS_GEN_FAILED="Failed to generate configuration file. Please check your input carefully!"
PROVIDERS_RESTART_ASK="Start/Restart service now?"
PROVIDERS_YES="Yes"
PROVIDERS_NO="No"
PROVIDERS_CRON_SUB_UPDATE="Update subscription"

View File

@@ -0,0 +1,34 @@
SCD_SELECT_INSTALL_DIR="Please select install directory:"
SCD_INPUT_NUM="Please enter a number"
SCD_INPUT_ERROR="Invalid input! Please retry!"
SCD_XIAOMI_DETECTED="Xiaomi stock firmware detected, select installation location:"
SCD_CUSTOM_DIR_WARN="Custom directory (not recommended)"
SCD_EXIT_INSTALL="Exit installation"
SCD_SELECT_USB_DIR="Please select USB directory:"
SCD_ASUS_DM_NOT_FOUND="Download Master startup file not found:"
SCD_CHECK_SETTING="please check your settings!"
SCD_ASUS_DETECTED="Asus firmware detected, please select installation method"
SCD_ASUS_INSTALL_DM="Install via USB + Download Master (all firmwares, ARM only)"
SCD_ASUS_INSTALL_SCRIPT="Install via startup script (some Merlin firmwares only)"
SCD_ASUS_DM_HINT="Install and enable Download Master in router web UI first, then select external storage directory."
SCD_ASUS_REINSTALL_HINT="If boot auto-start fails, please reinstall with USB + Download Master."
SCD_PATH_FORMAT_HINT="Path must start with /. Files under virtual memory (/tmp,/opt,/sys...) will be lost after reboot!"
SCD_PATH_FREE_SPACE="Available paths free space:"
SCD_INPUT_CUSTOM_DIR="Please input custom path"
SCD_PATH_ERROR="Invalid path! Please retry!"
SCD_INSTALL_SPACE_HINT="Notice: ShellCrash requires at least ~1MB free space"
SCD_INSTALL_ETC="Install in \033[32m/etc\033[0m (root users)"
SCD_INSTALL_USR="Install in \033[32m/usr/share\033[0m (Linux systems)"
SCD_INSTALL_HOME="Install in \033[32mcurrent user dir\033[0m (non-root users)"
SCD_INSTALL_USB="Install in \033[32mexternal storage\033[0m"
SCD_INSTALL_MANUAL="Set install directory manually"
SCD_INSTALL_CANCELED="Installation canceled"
SCD_NO_WRITE_PREFIX="No write permission on "
SCD_NO_WRITE_SUFFIX=", please retry!"
SCD_TARGET_DIR_PREFIX="Target directory "
SCD_TARGET_DIR_SPACE=" free space: "
SCD_CONFIRM_INSTALL="Confirm installation?"
SCD_YES="Yes"
SCD_NO="No"
SCD_DIR_FREE=" dir, free: "
SCD_SOFT_SOLID="(supports soft solidification)"

View File

@@ -0,0 +1,52 @@
SETBOOT_NOT_SET="Not set"
SETBOOT_SECOND="s"
SETBOOT_TITLE="Startup Settings"
SETBOOT_ITEM_AUTO="Autostart:"
SETBOOT_ITEM_OLD="Conservative mode:"
SETBOOT_ITEM_OLD_DESC="--- cron based check (every minute)"
SETBOOT_ITEM_DELAY="Startup delay:"
SETBOOT_ITEM_DELAY_DESC="--- helps when service is restricted right after boot"
SETBOOT_ITEM_MINI="Low-flash mode:"
SETBOOT_ITEM_MINI_DESC="--- for devices with limited flash space"
SETBOOT_ITEM_MINI_DIR="Low-flash directory:"
SETBOOT_ITEM_NETCHK="Startup network check:"
SETBOOT_ITEM_NETCHK_DESC="--- disable to skip network check on startup"
SETBOOT_VIEW_LOG="View startup logs"
SETBOOT_AUTO_OFF="ShellCrash autostart disabled!"
SETBOOT_AUTO_ON="ShellCrash autostart enabled!"
SETBOOT_CRON_INIT="ShellCrash initialization"
SETBOOT_OLDMODE_ON="Switched to conservative startup mode!"
SETBOOT_OLDMODE_OFF="Switched to system daemon startup mode!"
SETBOOT_MODE_UNSUPPORTED="Current device does not support other startup modes!"
SETBOOT_DELAY_HINT1="If your device runs normally after boot, no need to configure this."
SETBOOT_DELAY_HINT2="Recommended between 30~120 seconds, tune according to your device issue."
SETBOOT_DELAY_INPUT="Please enter startup delay (0~300s)"
SETBOOT_SET_OK="Set successfully!"
SETBOOT_DELAY_INVALID="Invalid input or over 300s, please retry!"
SETBOOT_MINI_NEEDED_NO="Your device has enough space (>20M), no need to enable!"
SETBOOT_SYSTEMD_WARN="systemd startup is unsupported here, enable conservative mode first!"
SETBOOT_MINI_ENABLED="Low-flash mode has been enabled!"
SETBOOT_MINI_DIR_HINT="To change directory, use [Set low-flash directory]."
SETBOOT_MINI_DISABLE_WARN="Remaining space is below 8M; disabling may break runtime!"
SETBOOT_MINI_DISABLE_CONFIRM="Confirm disabling this feature?"
SETBOOT_YES="Yes"
SETBOOT_NO_BACK="No, return"
SETBOOT_MINI_DISABLED="Low-flash mode has been disabled!"
SETBOOT_BINDIR_HINT1="If set to memory, related files will be re-downloaded after each boot."
SETBOOT_BINDIR_HINT2="Ensure install source is directly reachable, or startup may fail."
SETBOOT_BINDIR_TMP="Use memory (/tmp)"
SETBOOT_BINDIR_USB="Select USB directory"
SETBOOT_BINDIR_CUSTOM="Custom directory"
SETBOOT_SELECT_INSTALL_DIR="Please select install directory:"
SETBOOT_SPACE_USED="Used storage:"
SETBOOT_INPUT_ERROR="Invalid input, please retry!"
SETBOOT_INPUT_CMD="Please input command/path directly"
SETBOOT_INPUT_OR_BACK="Or input 0 to return"
SETBOOT_INPUT="Please enter"
SETBOOT_NETCHK_HINT1="If your device can run normally after boot, no need to change this."
SETBOOT_NETCHK_HINT2="When disabled, low-flash or online rules (e.g. rule-set) may fail due to no network."
SETBOOT_NETCHK_HINT3="When enabled, low-performance/slow-dial devices may timeout and fail startup."
SETBOOT_NETCHK_OFF_CONFIRM="Network check is \033[33mdisabled\033[0m. Enable it?"
SETBOOT_NETCHK_ON_CONFIRM="Network check is \033[33menabled\033[0m. Disable it?"
SETBOOT_TASK_WORD="Task"
SETBOOT_LOG_NOT_FOUND="Related log not found!"

View File

@@ -0,0 +1,33 @@
SUBCONVERTER_MENU_GEN="Generate config including all nodes and subscriptions"
SUBCONVERTER_MENU_EXCLUDE="Set \033[31mexclude node regex\033[0m"
SUBCONVERTER_MENU_INCLUDE="Set \033[32minclude node regex\033[0m"
SUBCONVERTER_MENU_RULE="Select \033[33monline rule template\033[0m"
SUBCONVERTER_MENU_SERVER="Select Subconverter server"
SUBCONVERTER_MENU_UA="Custom browser UA"
SUBCONVERTER_INPUT="Please enter"
SUBCONVERTER_BACK="or enter 0 to return"
SUBCONVERTER_EXCLUDE_HINT1="Nodes matching keywords will be blocked during import!"
SUBCONVERTER_INCLUDE_HINT1="Only nodes matching keywords will be imported!!!"
SUBCONVERTER_KEYWORD_SPLIT="Use \033[30;47m | \033[0m to separate multiple keywords"
SUBCONVERTER_REGEX_HINT="\033[32mRegex is supported\033[0m. Use \033[30;47m + \033[0m instead of spaces"
SUBCONVERTER_EXCLUDE_INPUT="Enter exclude keyword(s) directly"
SUBCONVERTER_INCLUDE_INPUT="Enter include keyword(s) directly"
SUBCONVERTER_EXCLUDE_CLEAR="or enter d to \033[31mclear\033[0m exclude keywords"
SUBCONVERTER_INCLUDE_CLEAR="or enter d to \033[31mclear\033[0m include keywords"
SUBCONVERTER_RULE_CURRENT="Current rule: "
SUBCONVERTER_SERVER_HINT="The following third-party servers are collected from the internet. Please evaluate their security by yourself!"
SUBCONVERTER_SERVER_THANKS="Thanks to the contributors below for their great work!!!"
SUBCONVERTER_SERVER_CURRENT="Current backend: "
SUBCONVERTER_SET_OK="Settings saved. Returning to previous menu"
SUBCONVERTER_UA_HINT="Try this if the config file cannot be fetched correctly"
SUBCONVERTER_UA_CURRENT="Current UA: "
SUBCONVERTER_UA_AUTO="Use auto UA (default)"
SUBCONVERTER_UA_NONE="Do not use UA"
SUBCONVERTER_UA_CUSTOM="Use custom UA"
SUBCONVERTER_UA_CLEAR="Clear UA"
SUBCONVERTER_UA_CUSTOM_WARN="Note:\nCustom UA cannot contain spaces or special symbols!"
SUBCONVERTER_UA_CUSTOM_INPUT="Enter custom UA"

View File

@@ -0,0 +1,19 @@
TASK_CMD_EVERY="every"
TASK_CMD_HOURLY="hourly"
TASK_CMD_MIN="minute"
TASK_CMD_CORE_SKIP="Task [Auto update core] skipped - no new version detected"
TASK_CMD_CORE_DONE="Task [Auto update core] download complete, restarting service"
TASK_CMD_CORE_DL_FAIL="Task [Auto update core] failed - download error"
TASK_CMD_CORE_VERIFY_FAIL="Task [Auto update core] failed - core verification error"
TASK_CMD_SCRIPT_SKIP="Task [Auto update script] skipped - no new version detected"
TASK_CMD_SCRIPT_UNZIP_FAIL="Task [Auto update script] failed - extract error"
TASK_CMD_DB_SKIP_PREFIX="Task [Auto update database] skipped - no new version for "
TASK_CMD_DB_SKIP_SUFFIX=""
TASK_CMD_DB_DL_FAIL_PREFIX="Task [Auto update database] failed downloading ["
TASK_CMD_DB_DL_FAIL_SUFFIX="]"
TASK_CMD_DB_OK_PREFIX="Task [Auto update database] updated ["
TASK_CMD_DB_OK_SUFFIX="] successfully"
TASK_CMD_RES_OK="success"
TASK_CMD_RES_FAIL="failed"
TASK_CMD_EXEC_PREFIX="Task ["
TASK_CMD_EXEC_MID="] result: "

View File

@@ -0,0 +1,13 @@
UNINSTALL_WARN="Warning: this action is irreversible!"
UNINSTALL_CONFIRM="Are you sure you want to uninstall ShellCrash?"
UNINSTALL_YES="Yes"
UNINSTALL_NO="No"
UNINSTALL_KEEP_CONFIRM="Keep script configs and subscription files?"
UNINSTALL_ENV_ERROR="Environment variable configuration is incorrect. Please remove the installation directory manually!"
UNINSTALL_DONE="ShellCrash related files have been removed. Goodbye!"
UNINSTALL_CLOSE_HINT="Please close the current terminal window manually to reset environment variables!"
UNINSTALL_CANCELED="Operation canceled!"
UNINSTALL_CRON_CLASH="clash service"
UNINSTALL_CRON_SUB="subscription link"
UNINSTALL_CRON_INIT="ShellCrash initialization"
UNINSTALL_SSH_MARK="Enable SSH access from WAN"

View File

@@ -0,0 +1,17 @@
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!"
UG_IMPORT_NOW="Import now"
UG_IMPORT_LATER="Not now"

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) $SET_YES" \
content_line "$SET_WARN_NONROOT" "0) $SET_NO_BACK"
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 "$SET_SKIP_CERT_NOW\033[33m$SET_DISABLED\033[0m$SET_SKIP_CERT_ENABLE_Q"
else else
content_line "当前\033[33m已启用\033[0m跳过本地证书验证是否确认禁用" content_line "$SET_SKIP_CERT_NOW\033[33m$SET_ENABLED\033[0m$SET_SKIP_CERT_DISABLE_Q"
fi fi
separator_line "=" separator_line "="
content_line "1) 是" btm_box "1) $SET_YES" \
content_line "0) 否,返回上级菜单" "0) $SET_NO_BACK"
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 "$SET_SNIFFER_NOW\033[33m$SET_DISABLED\033[0m$SET_SNIFFER_ENABLE_Q"
separator_line "=" btm_box "1) $SET_YES" \
content_line "1) 是" "0) $SET_NO_BACK"
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 "$SET_SNIFFER_NOW\033[33m$SET_ENABLED\033[0m$SET_SNIFFER_DISABLE_Q"
separator_line "=" btm_box "1) $SET_YES" \
content_line "1) 是" "0) $SET_NO_BACK"
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$COMMON_SUCCESS\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) $SET_YES" \
content_line "$SET_CORE_STOP_CONFIRM" "0) $SET_NO_BACK"
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) $SET_LANG_ZH" \
separator_line "=" "2) $SET_LANG_EN" \
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$SET_SWITCH_RERUN\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$SET_SWITCH_OK\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 $SET_MODE_SUFFIX\033[0m"
separator_line "="
content_line "\033[36m$SET_REDIR_APPLIED $redir_mod\033[0m"
separator_line "="
sleep 1
} }
# 路由模式设置 # 路由模式设置
@@ -310,31 +266,26 @@ 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) $SET_SET_TO\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) $SET_SET_TO\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) $SET_SET_TO\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) $SET_SET_TO\033[33m$SET_REDIR_TUN\033[0m\t$SET_REDIR_TUNDES"
content_line "" content_line ""
} }
[ "$firewall_area" = 5 ] && { [ "$firewall_area" = 5 ] && {
content_line "5) \033[32mTCP旁路转发\033[0m 仅转发TCP流量至旁路由" content_line "5) \033[32m$SET_BYPASS_TCP\033[0m $SET_BYPASS_TCP_DESC"
content_line "6) \033[36mT&U旁路转发\033[0m 转发TCP&UDP流量至旁路由" content_line "6) \033[36m$SET_BYPASS_TU\033[0m $SET_BYPASS_TU_DESC"
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,19 +334,15 @@ 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)
redir_mod='TCP旁路转发' redir_mod='$SET_BYPASS_TCP'
set_redir_config set_redir_config
;; ;;
6) 6)
redir_mod='T&U旁路转发' redir_mod='$SET_BYPASS_TU'
set_redir_config set_redir_config
;; ;;
7) 7)
@@ -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" "$SET_FW_AREA_CURRENT$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,35 +570,27 @@ 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$SET_WARN\033[0m" \
separator_line "=" "$SET_BYPASS_WARN_1" \
content_line "\033[31m注意\033[0m" "$SET_BYPASS_WARN_2" \
content_line "此功能存在多种风险如无网络基础请勿尝试!" "$SET_BYPASS_WARN_3" \
content_line "如需代理UDP请确保旁路由运行了支持UDP代理的模式" "\033[33m$SET_DESC\033[0m" \
content_line "如使用systemd方式启动内核依然会空载运行建议使用保守模式" "$SET_BYPASS_DESC_1" \
content_line "\033[33m说明\033[0m" "$SET_BYPASS_DESC_2"
content_line "此功能不启动内核仅配置防火墙转发且子设备无需额外设置网关DNS" read -r -p "$SET_INPUT_BYPASS_IPV4> " bypass_host
content_line "支持防火墙分流及设备过滤支持部分定时任务但不支持ipv6"
separator_line "="
read -r -p "请直接输入旁路由IPV4地址> " bypass_host
[ -n "$bypass_host" ] && { [ -n "$bypass_host" ] && {
firewall_area=$num firewall_area=$num
setconfig firewall_area "$firewall_area" setconfig firewall_area "$firewall_area"
setconfig bypass_host "$bypass_host" setconfig bypass_host "$bypass_host"
redir_mod=TCP旁路转发 redir_mod=$SET_BYPASS_TCP
setconfig redir_mod $redir_mod setconfig redir_mod $redir_mod
} }
;; ;;
*) *)
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" "$SET_TIPS_ENTER_BACK"
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

@@ -4,6 +4,8 @@
[ -n "$__IS_MODULE_4_SETBOOT_LOADED" ] && return [ -n "$__IS_MODULE_4_SETBOOT_LOADED" ] && return
__IS_MODULE_4_SETBOOT_LOADED=1 __IS_MODULE_4_SETBOOT_LOADED=1
load_lang setboot
allow_autostart() { allow_autostart() {
if [ -f /etc/rc.common ] && [ "$(cat /proc/1/comm)" = "procd" ]; then if [ -f /etc/rc.common ] && [ "$(cat /proc/1/comm)" = "procd" ]; then
/etc/init.d/shellcrash enable /etc/init.d/shellcrash enable
@@ -29,147 +31,119 @@ setboot() {
[ -z "$start_old" ] && start_old=OFF [ -z "$start_old" ] && start_old=OFF
if [ -z "$start_delay" ] || [ "$start_delay" = 0 ]; then if [ -z "$start_delay" ] || [ "$start_delay" = 0 ]; then
delay=未设置 delay="$SETBOOT_NOT_SET"
else else
delay="${start_delay}" delay="${start_delay}$SETBOOT_SECOND"
fi fi
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$SETBOOT_TITLE\033[0m"
separator_line "=" content_line "1) $SETBOOT_ITEM_AUTO \033[36m$(printf '%-4s' "$auto_set")\033[0m"
content_line "\033[30;47m启动设置菜单\033[0m" content_line "2) $SETBOOT_ITEM_OLD \033[36m$(printf '%-4s' "$start_old")\033[0m $SETBOOT_ITEM_OLD_DESC"
separator_line "=" content_line "3) $SETBOOT_ITEM_DELAY \033[36m$(printf '%-7s' "$delay")\033[0m $SETBOOT_ITEM_DELAY_DESC"
content_line "1) 开机自启动: \033[36m$(printf '%-4s' "$auto_set")\033[0m" content_line "4) $SETBOOT_ITEM_MINI \033[36m$(printf '%-4s' "$mini_clash")\033[0m $SETBOOT_ITEM_MINI_DESC"
content_line "2) 使用保守模式: \033[36m$(printf '%-4s' "$start_old")\033[0m ———基于定时任务(每分钟检测)" [ "${BINDIR}" != "$CRASHDIR" ] && content_line "5) $SETBOOT_ITEM_MINI_DIR \033[36m${BINDIR}\033[0m"
content_line "3) 设置自启延时: \033[36m$(printf '%-7s' "$delay")\033[0m ———用于解决自启后服务受限" btm_box "6) $SETBOOT_ITEM_NETCHK \033[36m$(printf '%-4s' "$network_check")\033[0m $SETBOOT_ITEM_NETCHK_DESC" \
content_line "4) 启用小闪存模式: \033[36m$(printf '%-4s' "$mini_clash")\033[0m ———用于闪存空间不足的设备" "7) $SETBOOT_VIEW_LOG" \
[ "${BINDIR}" != "$CRASHDIR" ] && content_line "5) 设置小闪存目录: \033[36m${BINDIR}\033[0m" "" \
content_line "6) 自启网络检查: \033[36m$(printf '%-4s' "$network_check")\033[0m ———禁用则跳过自启时网络检查" "0) $COMMON_BACK"
content_line "0) 返回上级菜单" read -r -p "$COMMON_INPUT> " num
separator_line "="
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$SETBOOT_AUTO_OFF\033[0m"
else else
# 允许自启动:配置各系统的启动项 # 允许自启动:配置各系统的启动项
allow_autostart allow_autostart
content_line "\033[32m已设置ShellCrash开机自启动\033[0m" msg_alert "\033[32m$SETBOOT_AUTO_ON\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$SETBOOT_OLDMODE_ON\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 "$SETBOOT_CRON_INIT"
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$SETBOOT_OLDMODE_OFF\033[0m"
else else
content_line "\033[31m当前设备不支持以其他模式启动!\033[0m" msg_alert "\033[31m$SETBOOT_MODE_UNSUPPORTED\033[0m"
fi fi
fi fi
separator_line "="
sleep 1
;; ;;
3) 3)
line_break comp_box "\033[33m$SETBOOT_DELAY_HINT1\033[0m" \
separator_line "=" "\033[36m$SETBOOT_DELAY_HINT2\033[0m"
content_line "\033[33m如果你的设备启动后可以正常使用则无需设置\033[0m" read -r -p "$SETBOOT_DELAY_INPUT> " sec
content_line "\033[36m推荐设置为30120秒之间请根据设备问题自行试验\033[0m"
separator_line "="
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$SETBOOT_SET_OK\033[0m"
;; ;;
*) *)
content_line "\033[31m输入有误或超过300秒请重新输入\033[0m" msg_alert "\033[31m$SETBOOT_DELAY_INVALID\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$SETBOOT_MINI_NEEDED_NO\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$SETBOOT_SYSTEMD_WARN\033[0m"
else else
[ "$BINDIR" = "$CRASHDIR" ] && BINDIR="$TMPDIR" [ "$BINDIR" = "$CRASHDIR" ] && BINDIR="$TMPDIR"
content_line "\033[32m已经启用小闪存功能!\033[0m" msg_alert "\033[32m$SETBOOT_MINI_ENABLED\033[0m" \
content_line "如需更换目录,请使用【设置小闪存目录】功能\033[0m" "$SETBOOT_MINI_DIR_HINT\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$SETBOOT_MINI_DISABLE_WARN\033[0m" \
content_line "是否确认停用此功能:" "$SETBOOT_MINI_DISABLE_CONFIRM"
separator_line "=" btm_box "1) $SETBOOT_YES" \
content_line "1) 是" "0) $SETBOOT_NO_BACK"
content_line "0) 否,返回上级菜单" read -r -p "$COMMON_INPUT> " res
separator_line "="
read -r -p "请输入对应标号> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
BINDIR="$CRASHDIR" BINDIR="$CRASHDIR"
line_break msg_alert "\033[33m$SETBOOT_MINI_DISABLED\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$SETBOOT_MINI_DISABLED\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$SETBOOT_BINDIR_HINT1\033[0m" \
separator_line "=" "\033[33m$SETBOOT_BINDIR_HINT2\033[0m"
content_line "\033[33m如设置到内存则每次开机后都自动重新下载相关文件\033[0m" btm_box "1) $SETBOOT_BINDIR_TMP" \
content_line "\033[33m请确保安装源可用裸连否则会导致启动失败\033[0m" "2) $SETBOOT_BINDIR_USB" \
separator_line "=" "3) $SETBOOT_BINDIR_CUSTOM" \
content_line "1) 使用内存(/tmp" "" \
content_line "2) 选择U盘目录" "0) $COMMON_BACK"
content_line "3) 自定义目录" read -r -p "$COMMON_INPUT> " num
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -180,27 +154,21 @@ setboot() {
2) 2)
set_usb_dir() { set_usb_dir() {
while true; do while true; do
line_break comp_box "$SETBOOT_SELECT_INSTALL_DIR"
separator_line "="
content_line "请选择安装目录:"
separator_line "="
du -hL /mnt | du -hL /mnt |
awk '{print NR") "$2" (已占用的储存空间:"$1""}' | awk '{print NR") "$2" ($SETBOOT_SPACE_USED$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) $COMMON_BACK"
separator_line "=" separator_line "="
read -r -p "请输入对应标号> " num read -r -p "$COMMON_INPUT> " num
BINDIR=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p) BINDIR=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p)
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$SETBOOT_INPUT_ERROR\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新设置\033[0m"
separator_line "="
else else
return 0 return 0
fi fi
@@ -214,20 +182,13 @@ setboot() {
3) 3)
input_dir() { input_dir() {
while true; do while true; do
line_break comp_box "\033[36m$SETBOOT_INPUT_CMD\033[0m" \
separator_line "=" "$SETBOOT_INPUT_OR_BACK"
content_line "请直接输入命令语句" read -r -p "$SETBOOT_INPUT> " BINDIR
content_line "或输入 0 返回上级菜单"
separator_line "="
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$SETBOOT_INPUT_ERROR\033[0m"
separator_line "="
content_line "\033[31m输入错误请重新设置\033[0m"
separator_line "="
continue
fi fi
return 0 return 0
done done
@@ -239,51 +200,54 @@ 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$SETBOOT_NETCHK_HINT1\033[0m" \
separator_line "=" "\033[36m$SETBOOT_NETCHK_HINT2\033[0m" \
content_line "\033[33m如果你的设备启动后可以正常使用则无需变更设置\033[0m" "\033[32m$SETBOOT_NETCHK_HINT3\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 "$SETBOOT_NETCHK_OFF_CONFIRM"
else else
content_line "当前\033[33m已启用\033[0m自启网络检查是否确认禁用" content_line "$SETBOOT_NETCHK_ON_CONFIRM"
fi fi
separator_line "-" separator_line "-"
content_line "1) 是" btm_box "1) $SETBOOT_YES" \
content_line "0) 否,返回上级菜单" "0) $SETBOOT_NO_BACK"
separator_line "=" read -r -p "$COMMON_INPUT> " res
read -r -p "请输入对应标号> " res
if [ "$res" = '1' ]; then if [ "$res" = '1' ]; then
if [ "$network_check" = "OFF" ]; then if [ "$network_check" = "OFF" ]; then
network_check=ON network_check=ON
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 "$SETBOOT_TASK_WORD" "$TMPDIR"/ShellCrash.log
separator_line "=" echo "==========================================================="
sleep 1 line_break
exit
else
msg_alert "\033[31m$SETBOOT_LOG_NOT_FOUND\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$TASK5_RUN_TASK\033[36m$task_name\033[0m" \
separator_line "=" "" \
content_line "\033[33m$cron_time\033[0m执行任务\033[36m$task_name\033[0m" "$TASK5_CONFIRM_ADD_CRON"
content_line "" btm_box "1) $TASK5_YES" \
content_line "是否确认添加定时任务:" "0) $TASK5_NO"
separator_line "=" read -r -p "$COMMON_INPUT> " res
content_line "1) 是"
content_line "0) 否"
separator_line "="
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 "$TASK5_TASK_PREFIX$cron_time$task_name$TASK5_TASK_ADDED"
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,44 +51,28 @@ set_service() {
# 自定义命令添加 # 自定义命令添加
task_user_add() { task_user_add() {
while true; do while true; do
line_break comp_box "\033[33m$TASK5_USER_ADD_HINT1\033[0m" \
separator_line "=" "\033[36m$TASK5_USER_ADD_HINT2\033[0m" \
content_line "\033[33m命令可包含空格请确保命令可执行\033[0m" "$TASK5_USER_ADD_HINT3\033[32m${CRASHDIR}/task/task.user\033[0m$TASK5_USER_ADD_HINT4"
content_line "\033[36m请勿附带执行条件,执行条件请在命令添加完成后再返回设置!\033[0m" btm_box "\033[36m$TASK5_INPUT_CMD\033[0m" \
content_line "亦可手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m以添加命令" "$TASK5_OR_BACK"
separator_line "-" read -r -p "$TASK5_INPUT> " script
content_line "请直接输入命令语句"
content_line "或输入 0 返回上级菜单"
separator_line "="
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 "$TASK5_CHECK_INPUT\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
task_id=$((task_max_id + 1)) task_id=$((task_max_id + 1))
read -r -p "请输入任务备注> " txt read -r -p "$TASK5_INPUT_REMARK> " txt
[ -n "$txt" ] && task_name=$txt || task_name=自定义任务$task_id [ -n "$txt" ] && task_name=$txt || task_name="$TASK5_CUSTOM_TASK$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$TASK5_CUSTOM_ADDED\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$TASK5_INPUT_ERROR\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 "$TASK5_USER_DEL_HINT1" \
content_line "也可以手动编辑\033[32m${CRASHDIR}/task/task.user\033[0m" "$TASK5_USER_DEL_HINT2\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) $COMMON_BACK"
content_line "0) 返回上级菜单" read -r -p "$COMMON_INPUT> " num
separator_line "="
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$TASK5_INPUT_ERROR\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$TASK5_NO_CUSTOM_TASK\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$TASK5_SELECT_ADD\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) $COMMON_BACK"
content_line "$line" read -r -p "$COMMON_INPUT> " num
done
content_line ""
content_line "0) 返回上级菜单"
separator_line "="
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,108 +151,90 @@ task_del() {
# 任务条件选择菜单 # 任务条件选择菜单
task_type() { task_type() {
line_break comp_box "$TASK5_SELECT_COND\033[36m【$task_name】\033[0m$TASK5_SELECT_COND2"
separator_line "=" btm_box "1) $TASK5_COND_1" \
content_line "请选择任务\033[36m【$task_name】\033[0m执行条件" "2) $TASK5_COND_2" \
separator_line "=" "3) $TASK5_COND_3" \
content_line "1) 定时任务\033[32m每周执行\033[0m" "4) $TASK5_COND_4" \
content_line "2) 定时任务\033[32m每日执行\033[0m" "$TASK5_WARN_LINE1" \
content_line "3) 定时任务\033[32m每小时执行\033[0m" "$TASK5_WARN_LINE2" \
content_line "4) 定时任务\033[32m每分钟执行\033[0m" "$TASK5_WARN_LINE3" \
content_line " - - - - - - - - -\033[31m注意\033[0m- - - - - - - - -" "5) $TASK5_COND_5" \
content_line " 逻辑水平不及格的请勿使用下方触发条件!" "6) $TASK5_COND_6" \
content_line " - - - - - - - - - - - - - - - - - - - -" "7) $TASK5_COND_7" \
content_line "5) 服务\033[33m启动前执行\033[0m" "8) $TASK5_COND_8" \
content_line "6) 服务\033[33m启动后执行\033[0m" "" \
content_line "7) 服务\033[33m运行时每分钟执行\033[0m" "0) $COMMON_BACK"
content_line "8) 防火墙服务\033[33m重启后执行\033[0m" read -r -p "$COMMON_INPUT> " num
content_line ""
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
0) 0)
return 1 return 1
;; ;;
1) 1)
line_break
separator_line "=" comp_box "$TASK5_WEEK_HINT1" \
content_line "输入 17 对应\033[33m每周的指定某天\033[0m运行7=周日)" "$TASK5_WEEK_HINT2" \
content_line "输入 140 代表\033[36m每周一、周四、周日\033[0m运行" "$TASK5_WEEK_HINT3"
content_line "输入 15 代表\033[36m周一至周五\033[0m运行" read -r -p "$TASK5_WEEK_INPUT> " week
separator_line "="
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 "$TASK5_HOUR_INPUT1> " hour
cron_time="在每周$week的$hour点整" cron_time="$TASK5_CRON_WEEK$week$TASK5_CRON_WEEK2$hour$TASK5_OCLOCK"
# cron_time=`echo ${cron_time/周0/周日}` # 把0换成日 # cron_time=`echo ${cron_time/周0/周日}` # 把0换成日
[ -n "$week" ] && [ -n "$hour" ] && set_cron [ -n "$week" ] && [ -n "$hour" ] && set_cron
;; ;;
2) 2)
line_break comp_box "$TASK5_DAY_HINT1" \
separator_line "=" "$TASK5_DAY_HINT2"
content_line "输入 1715 代表\033[36m每到1715点\033[0m运行" read -r -p "$TASK5_HOUR_INPUT2> " hour
content_line "输入 618 代表\033[36m早6点至晚18点间每小时\033[0m运行" read -r -p "$TASK5_MIN_INPUT> " min
separator_line "=" cron_time="$TASK5_CRON_DAY$hour$TASK5_POINT$min$TASK5_MINUTE"
read -r -p "想在每日的具体哪个小时执行0~23> " hour
read -r -p "想在具体哪分钟执行059的整数> " min
cron_time="在每日的$hour点$min分"
[ -n "$min" ] && [ -n "$hour" ] && set_cron [ -n "$min" ] && [ -n "$hour" ] && set_cron
;; ;;
3) 3)
line_break line_break
read -r -p "想每隔多少小时执行一次123的整数> " num read -r -p "$TASK5_EVERY_HOUR_INPUT> " num
hour="*/$num" hour="*/$num"
cron_time="每隔$num小时" cron_time="$TASK5_EVERY$num$TASK5_HOUR"
[ -n "$hour" ] && set_cron [ -n "$hour" ] && set_cron
;; ;;
4) 4)
line_break line_break
read -r -p "想每隔多少分钟执行一次159的整数> " num read -r -p "$TASK5_EVERY_MIN_INPUT> " num
min="*/$num" min="*/$num"
cron_time="每隔$num分钟" cron_time="$TASK5_EVERY$num$TASK5_MIN"
[ -n "$min" ] && set_cron [ -n "$min" ] && set_cron
;; ;;
5) 5)
set_service bfstart "$task_id" "服务启动前$task_name" set_service bfstart "$task_id" "$TASK5_BFSTART$task_name"
;; ;;
6) 6)
set_service afstart "$task_id" "服务启动后$task_name" set_service afstart "$task_id" "$TASK5_AFSTART$task_name"
;; ;;
7) 7)
line_break comp_box "$TASK5_RUNNING_HINT1" \
separator_line "=" "$TASK5_RUNNING_HINT2"
content_line "输入10即每隔10分钟运行一次1440即每隔24小时运行一次" read -r -p "$TASK5_RUNNING_INPUT> " num
content_line "大于60分钟的数值将按小时取整且按当前时区记时"
separator_line "="
read -r -p "想每隔多少分钟执行一次11440的整数> " num
if [ "$num" -lt 60 ]; then if [ "$num" -lt 60 ]; then
min="$num" min="$num"
cron_time="*/$min * * * *" cron_time="*/$min * * * *"
time_des="$min分钟" time_des="$min$TASK5_MIN"
else else
hour="$((num / 60))" hour="$((num / 60))"
cron_time="0 */$hour * * *" cron_time="0 */$hour * * *"
time_des="$hour小时" time_des="$hour$TASK5_HOUR"
fi fi
[ -n "$cron_time" ] && set_service running "$task_id" "运行时每$time_des$task_name" "$cron_time" [ -n "$cron_time" ] && set_service running "$task_id" "$TASK5_RUNNING_PREFIX$time_des$task_name" "$cron_time"
;; ;;
8) 8)
line_break comp_box "$TASK5_AFFW_HINT"
separator_line "=" "$TASK5_CONFIRM_CONTINUE"
content_line "该功能会将相关启动代码注入到/etc/init.d/firewall中" btm_box "1) $TASK5_YES" \
content_line "是否确认继续:" "0) $TASK5_NO"
separator_line "=" read -r -p "$COMMON_INPUT> " res
content_line "1) 是" [ "$res" = 1 ] && set_service affirewall "$task_id" "$TASK5_AFFW_PREFIX$task_name"
content_line "0) 否"
separator_line "="
read -r -p "请输入对应标号> " res
[ "$res" = 1 ] && set_service affirewall "$task_id" "防火墙重启后$task_name"
;; ;;
*) *)
errornum errornum
return 1
;; ;;
esac esac
} }
@@ -311,89 +242,65 @@ 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 "$TASK5_GUARD_WORD" | awk -F '#' '{print "0 '$TASK5_OLD_PREFIX'"$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$TASK5_NONE_TO_MANAGE\033[36m"
separator_line "="
sleep 1
break break
else else
content_line "\033[33m已添加的任务:\033[0m" comp_box "\033[33m$TASK5_ADDED_TASKS\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) $TASK5_CLEAR_OLD" \
content_line "d) 清空任务列表" "d) $TASK5_CLEAR_ALL" \
content_line "0) 返回上级菜单" "" \
separator_line "=" "0) $COMMON_BACK"
read -r -p "请输入对应标号> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
;; ;;
a) a)
task_del "#" task_del "#"
line_break msg_alert "\033[31m$TASK5_OLD_CLEARED\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$TASK5_ALL_CLEARED\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 "$TASK5_OLD_NOT_SUPPORT"
separator_line "=" btm_box "1) $TASK5_YES" \
content_line "1) 是" "0) $TASK5_NO_BACK"
content_line "0) 否,返回上级菜单" read -r -p "$COMMON_INPUT> " res
separator_line "="
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 "$TASK5_CURRENT_TASK\033[36m$task_des\033[0m"
content_line "当前任务为:\033[36m$task_des\033[0m" btm_box "1) $TASK5_EDIT_TASK" \
separator_line "=" "2) $TASK5_DEL_TASK" \
content_line "1) \033[33m修改\033[0m当前任务" "3) $TASK5_RUN_ONCE" \
content_line "2) \033[31m删除\033[0m当前任务" "4) $TASK5_VIEW_RECORD" \
content_line "3) \033[32m立即执行\033[0m一次" "" \
content_line "4) 查看\033[33m执行记录\033[0m" "0) $COMMON_BACK"
content_line "0) 返回上级菜单" read -r -p "$COMMON_INPUT> " num
separator_line "="
read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
continue continue
@@ -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="$TASK5_RUN_OK" || task_res="$TASK5_RUN_FAIL"
line_break msg_alert "\033[33m$TASK5_TASK_PREFIX$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$TASK5_RECORD_NOT_FOUND\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) $TASK5_YES" \
separator_line "=" "0) $TASK5_NO"
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 "="
} }
} }
@@ -472,21 +367,18 @@ task_recom() {
task_menu() { 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 "$TASK5_USER_FILE_HEADER" >"$CRASHDIR"/task/task.user
line_break comp_box "\033[30;47m$TASK5_MENU_TITLE\033[0m"
separator_line "=" btm_box "1) $TASK5_MENU_1" \
content_line "\033[30;47m自动任务菜单\033[0m" "2) $TASK5_MENU_2" \
separator_line "=" "3) $TASK5_MENU_3" \
content_line "1) 添加\033[32m自动任务\033[0m" "4) $TASK5_MENU_4" \
content_line "2) 管理\033[33m任务列表\033[0m" "5) $TASK5_MENU_5" \
content_line "3) 查看\033[36m任务日志\033[0m" "6) $TASK5_MENU_6" \
content_line "4) 配置\033[36m日志推送\033[0m" "7) $TASK5_MENU_7" \
content_line "5) 添加\033[33m自定义任务\033[0m" "" \
content_line "6) 删除\033[33m自定义任务\033[0m" "0) $COMMON_BACK"
content_line "7) 使用\033[32m推荐设置\033[0m" read -r -p "$COMMON_INPUT> " num
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -499,21 +391,17 @@ task_menu() {
rm -rf "$TMPDIR"/task_list rm -rf "$TMPDIR"/task_list
;; ;;
3) 3)
if cat "$TMPDIR"/ShellCrash.log | grep -q "$TASK5_TASK_GREP"; then
line_break line_break
if cat "$TMPDIR"/ShellCrash.log | grep -q '任务【'; then echo "==========================================================="
cat "$TMPDIR"/ShellCrash.log | grep '任务【' cat "$TMPDIR"/ShellCrash.log | grep "$TASK5_TASK_GREP"
echo "==========================================================="
else else
separator_line "=" msg_alert "\033[31m$TASK5_LOG_NOT_FOUND\033[0m"
content_line "\033[31m未找到任务相关执行日志\033[0m"
separator_line "="
sleep 1
fi fi
;; ;;
4) 4)
line_break msg_alert "\033[36m$TASK5_PUSH_HINT\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

@@ -4,6 +4,8 @@
[ -n "$__IS_MODULE_6_CORECONFIG_LOADED" ] && return [ -n "$__IS_MODULE_6_CORECONFIG_LOADED" ] && return
__IS_MODULE_6_CORECONFIG_LOADED=1 __IS_MODULE_6_CORECONFIG_LOADED=1
load_lang 6_core_config
if echo "$crashcore" | grep -q 'singbox'; then if echo "$crashcore" | grep -q 'singbox'; then
CONFIG_PATH="$CRASHDIR"/jsons/config.json CONFIG_PATH="$CRASHDIR"/jsons/config.json
CORE_TYPE=singbox CORE_TYPE=singbox
@@ -27,20 +29,21 @@ set_core_config() {
f2 = substr(f2, 1, 30) "..." f2 = substr(f2, 1, 30) "..."
printf "%-7s \t%-28s\n", f1, f2 printf "%-7s \t%-28s\n", f1, f2
}') }')
comp_box "\033[30;47m配置文件管理\033[0m" comp_box "\033[30;47m$CORECFG_TITLE\033[0m"
[ -n "$list" ] && { [ -n "$list" ] && {
content_line "\033[36m输入数字可管理对应提供者\033[0m" content_line "\033[36m$CORECFG_HINT_SELECT_PROVIDER\033[0m"
content_line ""
list_box "$list" list_box "$list"
separator_line "-" separator_line "-"
} }
content_line "a) \033[32m添加提供者\033[0m(支持订阅/分享链接及本地文件)" btm_box "a) $CORECFG_MENU_A" \
content_line "b) \033[36m本地生成配置文件\033[0m(By Providers,推荐!)" "b) $CORECFG_MENU_B" \
content_line "c) \033[33m在线生成配置文件\033[0m(By Subconverter)" "c) $CORECFG_MENU_C" \
content_line "d) \033[31m清空提供者列表\033[0m" "d) $CORECFG_MENU_D" \
content_line "e) \033[36m自定义配置文件\033[0m" "e) $CORECFG_MENU_E" \
"" \
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,10 +61,10 @@ 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$CORECFG_CORE_ONLY\033[0m"
fi fi
else else
msg_alert "请先添加提供者!" msg_alert "$CORECFG_ADD_PROVIDER_FIRST"
fi fi
;; ;;
c) c)
@@ -69,14 +72,16 @@ set_core_config() {
. "$CRASHDIR"/menus/subconverter.sh . "$CRASHDIR"/menus/subconverter.sh
subconverter subconverter
else else
msg_alert "请先添加提供者!" msg_alert "$CORECFG_ADD_PROVIDER_FIRST"
fi fi
;; ;;
d) d)
separator_line "=" comp_box "\033[33m$CORECFG_CLEAR_WARN\033[0m" \
content_line "\033[33m警告这将删除所有提供者且无法还原\033[0m" "" \
separator_line "-" "$CORECFG_CLEAR_CONFIRM"
read -r -p "确认清空提供者列表?(1/0) > " res btm_box "1) $CORECFG_YES" \
"0) $CORECFG_NO_BACK"
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 +89,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 +117,7 @@ setproviders() {
include_w=${7#\#} include_w=${7#\#}
;; ;;
*://*) *://*)
set -- $line set -- $@
name=$1 name=$1
link_uri=$2 link_uri=$2
;; ;;
@@ -125,49 +129,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$CORECFG_PROVIDER_SUPPORT\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 "1) $CORECFG_SET_NAME \033[32m$name\033[0m"
content_line "2) $CORECFG_SET_LINK \033[36m$link_info\033[0m"
[ -n "$link" ] && [ -n "$link" ] &&
content_line "3) 设置\033[33m本地生成覆写\033[0m" content_line "3) $CORECFG_SET_OVERRIDE"
separator_line "-" content_line ""
content_line "a) \033[36m保存此提供者\033[0m" content_line "a) $CORECFG_SAVE_PROVIDER"
content_line "d) $CORECFG_DEL_PROVIDER"
content_line ""
content_line "\033[36m$CORECFG_MORE_CONFIG_HINT\033[0m"
[ -n "$link" ] && [ -n "$link" ] &&
content_line "b) \033[32m本地生成\033[0m仅包含此提供者的配置文件" content_line "b) $CORECFG_GEN_LOCAL_ONE"
echo "$link$link_uri" | grep -q '://' && echo "$link$link_uri" | grep -q '://' &&
content_line "c) \033[33m在线生成\033[0m仅包含此提供者的配置文件" content_line "c) $CORECFG_GEN_ONLINE_ONE"
echo "$link" | grep -q '^http' && echo "$link" | grep -q '^http' &&
content_line "e) 从此订阅链接直接拉取配置文件(不经过订阅转换)" content_line "e) $CORECFG_GET_ONLINE_DIRECT"
echo "$link" | grep -q '^./providers' && echo "$link" | grep -q '^./providers' &&
content_line "e) 直接使用此文件作为配置文件(不经过本地生成)" content_line "e) $CORECFG_USE_DIRECT"
content_line "d) \033[31m删除此提供者\033[0m" btm_box "" \
common_back "0) $COMMON_BACK"
read -r -p "请输入对应字母或数字> " input read -r -p "$CORECFG_INPUT_ALNUM> " 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$CORECFG_NAME_HINT\033[0m"
separator_line "-" btm_box "\033[36m$CORECFG_INPUT_NAME\033[0m" \
read -r -p "请输入具体名称或代号 > " text "$CORECFG_OR_BACK"
text=$(printf "%.12s" "$text" | sed 's/ //g') #截断12字符+去空格 read -r -p "$CORECFG_INPUT> " 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 "$CORECFG_LINK_HINT1" \
content_line "\033[36m分享链接\033[0m: $URI_EXP" "" \
content_line "\033[33m本地文件\033[0m: 必须放在此目录下:\033[32m$CRASHDIR/providers\033[0m" "$CORECFG_LINK_HINT2\n$URI_EXP" \
content_line "\033[36m Base64 \033[0m: 请直接写入本地文件" "" \
separator_line "-" "$CORECFG_LINK_HINT3\033[32m$CRASHDIR/providers\033[0m$CORECFG_LINK_HINT4" \
"" \
"$CORECFG_LINK_HINT5"
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 +192,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 "$CORECFG_INPUT0_BACK"
read -r -p "$CORECFG_SELECT_FILE_OR_LINK> " text
else else
read -r -p "请输入具体链接 > " text btm_box "\033[36m$CORECFG_INPUT_LINK\033[0m" \
"$CORECFG_OR_BACK"
read -r -p "$CORECFG_INPUT> " 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 +256,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$CORECFG_FILL_REQUIRED\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$CORECFG_FILL_REQUIRED\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$CORECFG_DANGER1\033[0m" \
content_line "\033[31m请确认你完全理解自己在做什么\033[0m" "\033[31m$CORECFG_DANGER2\033[0m"
read -p "我确认遇到问题可以自行解决(1/0) > " res btm_box "1) $CORECFG_DANGER_CONFIRM" \
"0) $COMMON_BACK"
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 +307,21 @@ setproviders() {
jump_core_config jump_core_config
break break
else else
content_line "\033[31m请先完成必填选项!\033[0m" msg_alert "\033[31m$CORECFG_FILL_REQUIRED\033[0m"
fi fi
} }
else else
content_line "\033[31m请先完成必填选项!\033[0m" msg_alert "\033[31m$CORECFG_FILL_REQUIRED\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
@@ -306,91 +334,158 @@ saveproviders() {
echo "$name $link_uri" >>"$CRASHDIR"/configs/providers_uri.cfg echo "$name $link_uri" >>"$CRASHDIR"/configs/providers_uri.cfg
return 0 return 0
else else
msg_alert "\033[31m请先完成必填选项!\033[0m" msg_alert "\033[31m$CORECFG_FILL_REQUIRED\033[0m"
return 1 return 1
fi fi
} }
#本地生成覆写
# 本地生成覆写
custproviders() { custproviders() {
while true; do while true; do
separator_line '-' top_box "1) $CORECFG_INTERVAL1\033[47;30m$interval\033[0m $CORECFG_MIN" \
content_line "1) 设置\033[33m健康检查间隔\033[0m\t\033[47;30m$interval\033[0m" "2) $CORECFG_INTERVAL2\033[47;30m$interval2\033[0m $CORECFG_HOUR"
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) $CORECFG_SET_UA\033[47;30m$ua\033[0m"
content_line "4) 设置\033[31m排除节点正则\033[0m\t\033[47;30m$exclude_w\033[0m" btm_box "4) $CORECFG_SET_EXCLUDE\033[47;30m$exclude_w\033[0m" \
content_line "5) 设置\033[32m包含节点正则\033[0m\t\033[47;30m$include_w\033[0m" "5) $CORECFG_SET_INCLUDE\033[47;30m$include_w\033[0m" \
common_back "" \
read -r -p "请输入对应数字> " num "0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " 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 "$CORECFG_CUR_INTERVAL$interval $CORECFG_MIN"
btm_box "\033[36m$CORECFG_INPUT_INTERVAL1\033[0m" \
"$CORECFG_RESET_INTERVAL1" \
"$CORECFG_OR_BACK"
read -r -p "$CORECFG_INPUT> " 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 "$CORECFG_CUR_INTERVAL$interval $CORECFG_MIN"
btm_box "\033[36m$CORECFG_INPUT_INTERVAL2\033[0m" \
"$CORECFG_RESET_INTERVAL2" \
"$CORECFG_OR_BACK"
read -r -p "$CORECFG_INPUT> " 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 "$CORECFG_CUR_UA_NONE"
else
comp_box "$CORECFG_CUR_UA$ua"
fi
btm_box "\033[36m$CORECFG_INPUT_UA\033[0m" \
"$CORECFG_RESET_UA" \
"$CORECFG_OR_BACK"
read -r -p "$CORECFG_INPUT> " 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 "$CORECFG_CUR_EXCLUDE_NONE"
else
comp_box "$CORECFG_CUR_EXCLUDE$exclude_w"
fi
btm_box "\033[36m$CORECFG_INPUT_EXCLUDE\033[0m" \
"$CORECFG_CLEAR_EXCLUDE" \
"$CORECFG_OR_BACK"
read -r -p "$CORECFG_INPUT> " 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 "$CORECFG_CUR_INCLUDE_NONE"
else
comp_box "$CORECFG_CUR_INCLUDE$include_w"
fi
btm_box "\033[36m$CORECFG_INPUT_INCLUDE\033[0m" \
"$CORECFG_CLEAR_INCLUDE" \
"$CORECFG_OR_BACK"
read -r -p "$CORECFG_INPUT> " 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 "$CORECFG_START_APPLY"
[ "$res" = 1 ] && start_core || main_menu btm_box "1) $CORECFG_YES" \
"0) $CORECFG_NO"
read -r -p "$COMMON_INPUT> " res
if [ "$res" = 1 ]; then
start_core
else
main_menu
fi
exit exit
fi fi
fi fi

View File

@@ -7,14 +7,12 @@ __IS_MODULE_7_GATEWAY_LOADED=1
. "$GT_CFG_PATH" . "$GT_CFG_PATH"
. "$CRASHDIR"/menus/check_port.sh . "$CRASHDIR"/menus/check_port.sh
. "$CRASHDIR"/libs/gen_base64.sh . "$CRASHDIR"/libs/gen_base64.sh
load_lang 7_gateway
# 访问与控制主菜单 # 访问与控制主菜单
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 +22,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) $COMMON_BACK"
read -r -p "请输入对应标号> " num read -r -p "$COMMON_INPUT> " 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 +61,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,27 +91,23 @@ 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) $COMMON_BACK"
read -r -p "请输入对应标号> " num read -r -p "$COMMON_INPUT> " num
case $num in case $num in
"" | 0) "" | 0)
break break
;; ;;
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 +120,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
read -r -p "请输入要放行的端口号> " port line_break
read -r -p "$GW_INPUT_ALLOW_PORT> " 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
@@ -230,16 +189,13 @@ set_bot_tg_config() {
} }
EOF EOF
) )
TEXT="已完成Telegram机器人设置请使用 /$my_alias 呼出功能菜单!" TEXT="$GW_TG_DONE_PREFIX /$my_alias $GW_TG_DONE_SUFFIX"
. "$CRASHDIR"/libs/web_json.sh . "$CRASHDIR"/libs/web_json.sh
bot_api="https://api.telegram.org/bot$TOKEN" bot_api="https://api.telegram.org/bot$TOKEN"
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,24 +214,23 @@ 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"
} }
set_bot_tg() { 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="$GW_SET"
[ -n "$TG_CHATID" ] && TG_CHATID_info='已绑定' [ -n "$TG_CHATID" ] && TG_CHATID_info="$GW_BOUND"
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) $COMMON_BACK"
content_line "0) 返回上级菜单" read -r -p "$COMMON_INPUT> " num
separator_line "="
read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -285,23 +240,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 +258,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 +277,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,10 +288,10 @@ 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) $COMMON_BACK"
read -r -p "请输入对应标号> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -353,17 +305,13 @@ 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
;; ;;
2) 2)
line_break line_break
read -r -p "请输入端口号输入0删除> " text read -r -p "$GW_INPUT_PORT_DEL0> " text
if [ "$text" = 0 ]; then if [ "$text" = 0 ]; then
vms_port='' vms_port=''
setconfig vms_port "" "$GT_CFG_PATH" setconfig vms_port "" "$GT_CFG_PATH"
@@ -376,7 +324,7 @@ set_vmess() {
;; ;;
3) 3)
line_break line_break
read -r -p "请输入ws-path路径输入0删除> " text read -r -p "$GW_INPUT_WSPATH> " text
if [ "$text" = 0 ]; then if [ "$text" = 0 ]; then
vms_ws_path='' vms_ws_path=''
setconfig vms_ws_path "" "$GT_CFG_PATH" setconfig vms_ws_path "" "$GT_CFG_PATH"
@@ -384,16 +332,12 @@ 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)
line_break line_break
read -r -p "请输入UUID输入0删除> " text read -r -p "$GW_INPUT_UUID> " text
if [ "$text" = 0 ]; then if [ "$text" = 0 ]; then
vms_uuid='' vms_uuid=''
setconfig vms_uuid "" "$GT_CFG_PATH" setconfig vms_uuid "" "$GT_CFG_PATH"
@@ -401,11 +345,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 +388,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,22 +402,19 @@ 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) $COMMON_BACK"
read -r -p "请输入对应标号> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -495,17 +428,13 @@ 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
;; ;;
2) 2)
line_break line_break
read -r -p "请输入端口号输入0删除> " text read -r -p "$GW_INPUT_PORT_DEL0> " text
if [ "$text" = 0 ]; then if [ "$text" = 0 ]; then
sss_port='' sss_port=''
setconfig sss_port "" "$GT_CFG_PATH" setconfig sss_port "" "$GT_CFG_PATH"
@@ -517,10 +446,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,10 +459,9 @@ 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) $COMMON_BACK"
separator_line "=" read -r -p "$COMMON_INPUT> " num
read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
0) ;; 0) ;;
1) 1)
@@ -569,20 +494,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"
@@ -590,22 +511,18 @@ set_shadowsocks() {
;; ;;
5) 5)
line_break line_break
read -r -p "请输入本机公网IP(4/6)或域名> " text read -r -p "$GW_INPUT_HOST> " text
if [ -n "$text" ] && [ -n "$sss_port" ] && [ -n "$sss_cipher" ] && [ -n "$sss_pwd" ]; then if [ -n "$text" ] && [ -n "$sss_port" ] && [ -n "$sss_cipher" ] && [ -n "$sss_pwd" ]; then
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,21 +532,18 @@ 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) $COMMON_BACK"
content_line "5) 设置\033[36m设备名称\033[0m可选 $ts_hostname" read -r -p "$COMMON_INPUT> " num
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -639,11 +553,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 +571,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 +585,6 @@ set_tailscale() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done
@@ -708,25 +610,20 @@ 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) $COMMON_BACK"
content_line "7) 设置\033[33m组网IPV4地址\033[0m \033[33m$wg_ipv4\033[0m" read -r -p "$COMMON_INPUT> " num
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
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -736,11 +633,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 +673,6 @@ set_wireguard() {
;; ;;
*) *)
errornum errornum
sleep 1
;; ;;
esac esac
done done

View File

@@ -6,6 +6,7 @@ __IS_MODULE_8_TOOLS_LOADED=1
. "$CRASHDIR"/libs/logger.sh . "$CRASHDIR"/libs/logger.sh
. "$CRASHDIR"/libs/web_get_bin.sh . "$CRASHDIR"/libs/web_get_bin.sh
load_lang 8_tools
stop_iptables() { stop_iptables() {
iptables -w -t nat -D PREROUTING -p tcp -m multiport --dports "$ssh_port" -j REDIRECT --to-ports 22 >/dev/null 2>&1 iptables -w -t nat -D PREROUTING -p tcp -m multiport --dports "$ssh_port" -j REDIRECT --to-ports 22 >/dev/null 2>&1
@@ -14,20 +15,16 @@ stop_iptables() {
ssh_tools() { 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=$TOOLS_SSH_DISABLE || ssh_ol=$TOOLS_SSH_ENABLE
[ -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" read -r -p "$COMMON_INPUT> " num
content_line ""
content_line "0) 返回上级菜单 \033[0m"
separator_line "="
read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -38,56 +35,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$TOOLS_ERR_PORT\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$TOOLS_ERR_PORT_OCCUPIED\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$TOOLS_SSH_SET_OK"
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 "$TOOLS_SSH_ENABLED"
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 "$TOOLS_SSH_DISABLED"
separator_line "="
content_line "已禁止外网访问SSH"
separator_line "="
fi fi
break break
;; ;;
*) *)
errornum errornum
sleep 1
break
;; ;;
esac esac
done done
@@ -97,18 +76,14 @@ ssh_tools() {
tools() { tools() {
while true; do while true; do
# 获取设置默认显示 # 获取设置默认显示
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=$TOOLS_DISABLE || mi_update=$TOOLS_ENABLE
[ "$mi_mi_autoSSH" = "已配置" ] && mi_mi_autoSSH_type=32m已配置 || mi_mi_autoSSH_type=31m未配置 [ "$mi_mi_autoSSH" = "$TOOLS_CONFIGURED" ] && mi_mi_autoSSH_type=32m$TOOLS_CONFIGURED || mi_mi_autoSSH_type=31m$COMMON_UNSET
[ -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$TOOLS_TITLE\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,10 +91,9 @@ 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) $COMMON_BACK"
separator_line "=" read -r -p "$COMMON_INPUT> " num
read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -149,21 +123,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 +152,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) $COMMON_BACK"
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,35 +179,28 @@ 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=$TOOLS_CONFIGURED
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
cp -f /etc/dropbear/authorized_keys "$CRASHDIR"/configs/authorized_keys 2>/dev/null cp -f /etc/dropbear/authorized_keys "$CRASHDIR"/configs/authorized_keys 2>/dev/null
ckcmd nvram && { ckcmd nvram && {
@@ -259,13 +210,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$COMMON_SUCCESS\033[0m"
} }
# 日志菜单 # 日志菜单
@@ -280,37 +227,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) $COMMON_BACK"
content_line "" read -r -p "$COMMON_INPUT> " num
content_line "0) 返回上级菜单"
separator_line "="
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,11 +264,11 @@ 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) $COMMON_BACK"
read -r -p "请输入对应标号> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
0) 0)
return 0 return 0
@@ -350,14 +290,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 +303,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 +317,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 +337,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 +349,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 +369,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) $COMMON_BACK"
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 +391,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 +415,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 +426,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 +443,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 +462,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 +480,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 +492,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 +513,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 +522,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,41 +534,35 @@ 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) $COMMON_BACK"
content_line "6) 测试代理服务器连通性(google.tw)" read -r -p "$COMMON_INPUT> " num
content_line ""
content_line "0) 返回上级目录"
separator_line "="
read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
0) 0)
break break
;; ;;
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 +614,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,26 +648,22 @@ 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) $COMMON_BACK"
separator_line "=" read -r -p "$COMMON_INPUT> " num
read -r -p "请输入对应标号> " num
case "$num" in case "$num" in
0) ;; 0) ;;
1) 1)
@@ -855,15 +704,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 +720,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
;; ;;

File diff suppressed because it is too large Load Diff

View File

@@ -2,11 +2,15 @@
[ -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"/libs/i18n.sh
. "$CRASHDIR"/menus/running_status.sh . "$CRASHDIR"/menus/running_status.sh
. "$CRASHDIR"/configs/gateway.cfg . "$CRASHDIR"/configs/gateway.cfg
. "$CRASHDIR"/configs/ShellCrash.cfg . "$CRASHDIR"/configs/ShellCrash.cfg
load_lang bot_tg
TMPDIR='/tmp/ShellCrash' TMPDIR='/tmp/ShellCrash'
API="https://api.telegram.org/bot$TG_TOKEN" API="https://api.telegram.org/bot$TG_TOKEN"
STATE_FILE="$TMPDIR/tgbot_state" STATE_FILE="$TMPDIR/tgbot_state"
@@ -31,15 +35,15 @@ send_msg(){
} }
send_help(){ send_help(){
TEXT=$(cat <<EOF TEXT=$(cat <<EOF
进群讨论: $BOT_TG_HELP_GROUP
https://t.me/+6AElkMDzwPxmMmM1 https://t.me/+6AElkMDzwPxmMmM1
项目地址: $BOT_TG_HELP_PROJECT
https://github.com/juewuy/ShellClash https://github.com/juewuy/ShellClash
相关教程: $BOT_TG_HELP_GUIDE
https://juewuy.github.io https://juewuy.github.io
请喝咖啡: $BOT_TG_HELP_COFFEE
https://juewuy.github.io/yOF4Yf06Q/ https://juewuy.github.io/yOF4Yf06Q/
友情机场: $BOT_TG_HELP_AIRPORT
https://dler.pro/auth/register?affid=89698 https://dler.pro/auth/register?affid=89698
https://pub.bigmeok.me?code=2PuWY9I7 https://pub.bigmeok.me?code=2PuWY9I7
EOF EOF
@@ -50,31 +54,31 @@ send_menu(){
#获取运行状态 #获取运行状态
PID=$(pidof CrashCore | awk '{print $NF}') PID=$(pidof CrashCore | awk '{print $NF}')
if [ -n "$PID" ]; then if [ -n "$PID" ]; then
run='🟢正在运行' run="$BOT_TG_RUN_ON"
running_status running_status
else else
run='🟡未运行' run="$BOT_TG_RUN_OFF"
fi fi
corename=$(echo $crashcore | sed 's/singboxr/SingBoxR/' | sed 's/singbox/SingBox/' | sed 's/clash/Clash/' | sed 's/meta/Mihomo/') corename=$(echo $crashcore | sed 's/singboxr/SingBoxR/' | sed 's/singbox/SingBox/' | sed 's/clash/Clash/' | sed 's/meta/Mihomo/')
TEXT=$(cat <<EOF TEXT=$(cat <<EOF
*欢迎使用ShellCrash*_${versionsh_l}_ *$BOT_TG_WELCOME*_${versionsh_l}_
$corename服务$run $corename$BOT_TG_SERVICE$run
【*$redir_mod*】内存占用:$VmRSS 【*$redir_mod*】$BOT_TG_MEM_USED$VmRSS
已运行:$day$time $BOT_TG_RUNNING_TIME$day$time
请选择操作: $BOT_TG_SELECT_ACTION
EOF EOF
) )
MENU=$(cat <<EOF MENU=$(cat <<EOF
{ {
"inline_keyboard":[ "inline_keyboard":[
[ [
{"text":"✈️ 启用劫持","callback_data":"start_redir"}, {"text":"$BOT_TG_BTN_START","callback_data":"start_redir"},
{"text":"💧 纯净模式","callback_data":"stop_redir"}, {"text":"$BOT_TG_BTN_PURE","callback_data":"stop_redir"},
{"text":"🕹 重启服务","callback_data":"restart"} {"text":"$BOT_TG_BTN_RESTART","callback_data":"restart"}
], ],
[ [
{"text":"📄 查看日志","callback_data":"readlog"}, {"text":"$BOT_TG_BTN_LOG","callback_data":"readlog"},
{"text":"🔃 文件传输","callback_data":"transport"} {"text":"$BOT_TG_BTN_TRANSFER","callback_data":"transport"}
] ]
] ]
} }
@@ -84,7 +88,7 @@ web_json_post "$API/sendMessage" "{\"chat_id\":\"$TG_CHATID\",\"text\":\"$TEXT\"
} }
### --- 文件传输 --- ### ### --- 文件传输 --- ###
send_transport_menu(){ send_transport_menu(){
TEXT='请选择需要上传或下载的具体文件:' TEXT="$BOT_TG_SELECT_FILE"
if echo "$crashcore" | grep -q 'singbox';then if echo "$crashcore" | grep -q 'singbox';then
config_type=json config_type=json
else else
@@ -94,23 +98,23 @@ send_transport_menu(){
if curl -h >/dev/null 2>&1;then if curl -h >/dev/null 2>&1;then
CURL_KB=$(cat <<EOF CURL_KB=$(cat <<EOF
[ [
{"text":"📥 下载日志","callback_data":"ts_get_log"}, {"text":"$BOT_TG_BTN_GET_LOG","callback_data":"ts_get_log"},
{"text":"💾 备份设置","callback_data":"ts_get_bak"}, {"text":"$BOT_TG_BTN_GET_BAK","callback_data":"ts_get_bak"},
{"text":"⬇️ 下载配置","callback_data":"ts_get_ccf"} {"text":"$BOT_TG_BTN_GET_CFG","callback_data":"ts_get_ccf"}
], ],
EOF EOF
) )
else else
CURL_KB='[{"text":"⚠️ 因当前设备缺少curl应用仅支持上传功能","callback_data":"noop"}],' CURL_KB='[{"text":"$BOT_TG_NO_CURL","callback_data":"noop"}],'
fi fi
MENU=$(cat <<EOF MENU=$(cat <<EOF
{ {
"inline_keyboard":[ "inline_keyboard":[
$CURL_KB $CURL_KB
[ [
{"text":"🪐 上传内核","callback_data":"ts_up_core"}, {"text":"$BOT_TG_BTN_UP_CORE","callback_data":"ts_up_core"},
{"text":"🔄 还原设置","callback_data":"ts_up_bak"}, {"text":"$BOT_TG_BTN_UP_BAK","callback_data":"ts_up_bak"},
{"text":"⬆️ 上传配置","callback_data":"ts_up_ccf"} {"text":"$BOT_TG_BTN_UP_CFG","callback_data":"ts_up_ccf"}
] ]
] ]
} }
@@ -124,17 +128,17 @@ process_file(){
case "$FILE_TYPE" in case "$FILE_TYPE" in
1) 1)
. "$CRASHDIR"/libs/core_tools.sh . "$CRASHDIR"/libs/core_tools.sh
core_check "$TMPDIR/$FILE_NAME" && res='成功!即将重启服务!' || res='失败,请仔细检查文件或重试!' core_check "$TMPDIR/$FILE_NAME" && res="$BOT_TG_UPLOAD_OK" || res="$BOT_TG_UPLOAD_FAIL"
send_msg "内核更新$res" send_msg "$BOT_TG_CORE_UPDATE$res"
sleep 2 sleep 2
"$CRASHDIR"/start.sh start "$CRASHDIR"/start.sh start
;; ;;
2) 2)
tar -zxf "$TMPDIR/$FILE_NAME" -C "$CRASHDIR"/configs && res='配置文件已还原,请手动重启服务!' || res='解压还原失败,请仔细检查文件或重试!' tar -zxf "$TMPDIR/$FILE_NAME" -C "$CRASHDIR"/configs && res="$BOT_TG_CFG_RESTORED" || res="$BOT_TG_RESTORE_FAIL"
send_msg "$res" send_msg "$res"
;; ;;
3) 3)
mv -f "$TMPDIR/$FILE_NAME" "$CRASHDIR/${config_type}s/" && res='配置文件已上传,请手动重启服务!' || res='上传失败,请仔细检查文件或重试!' mv -f "$TMPDIR/$FILE_NAME" "$CRASHDIR/${config_type}s/" && res="$BOT_TG_CFG_UPLOADED" || res="$BOT_TG_UPLOAD_FAIL2"
send_msg "$res" send_msg "$res"
;; ;;
esac esac
@@ -150,10 +154,10 @@ download_file(){
if [ "$?" = 0 ];then if [ "$?" = 0 ];then
process_file process_file
else else
send_msg "网络错误,上传失败!请重试!" send_msg "$BOT_TG_NET_UPLOAD_FAIL"
fi fi
else else
send_msg "文件格式不匹配,上传失败!" send_msg "$BOT_TG_FILE_FORMAT_FAIL"
fi fi
} }
### --- 具体操作函数 --- ### ### --- 具体操作函数 --- ###
@@ -162,22 +166,22 @@ do_start_fw(){
redir_mod=$redir_mod_bf redir_mod=$redir_mod_bf
setconfig redir_mod $redir_mod setconfig redir_mod $redir_mod
"$CRASHDIR"/start.sh start_firewall "$CRASHDIR"/start.sh start_firewall
echo "ShellCrash 透明路由*$redir_mod_bf*已启用!" > "$LOGFILE" echo "$BOT_TG_FW_ENABLED*$redir_mod_bf*$BOT_TG_FW_ENABLED_SUFFIX" > "$LOGFILE"
} }
do_stop_fw(){ do_stop_fw(){
redir_mod_bf=$redir_mod redir_mod_bf=$redir_mod
firewall_area=4 firewall_area=4
setconfig firewall_area 4 setconfig firewall_area 4
"$CRASHDIR"/start.sh stop_firewall "$CRASHDIR"/start.sh stop_firewall
echo "ShellCrash 已切换到纯净模式!" > "$LOGFILE" echo "$BOT_TG_SWITCH_PURE" > "$LOGFILE"
} }
do_restart(){ do_restart(){
"$CRASHDIR"/start.sh restart "$CRASHDIR"/start.sh restart
echo "ShellCrash 服务已重启!" > "$LOGFILE" echo "$BOT_TG_SERVICE_RESTARTED" > "$LOGFILE"
} }
do_set_sub(){ do_set_sub(){
#echo "$1" "$2" >> "$CRASHDIR"/configs/providers.cfg #echo "$1" "$2" >> "$CRASHDIR"/configs/providers.cfg
echo "错误,还未完成的功能!" > "$LOGFILE" echo "$BOT_TG_UNFINISHED" > "$LOGFILE"
} }
transport(){ #文件传输 transport(){ #文件传输
@@ -203,15 +207,15 @@ transport(){ #文件传输
;; ;;
"ts_up_core") "ts_up_core")
FILE_TYPE=1 FILE_TYPE=1
send_msg "请发送需要上传的内核必须是以tar.gz,.gz或.upx结尾的【${corename}】内核!" send_msg "$BOT_TG_SEND_CORE ${corename} $BOT_TG_SEND_CORE_SUFFIX"
;; ;;
"ts_up_bak") "ts_up_bak")
FILE_TYPE=2 FILE_TYPE=2
send_msg "请发送需要还原的备份文件,必须是【.tar.gz】格式" send_msg "$BOT_TG_SEND_BAK"
;; ;;
"ts_up_ccf") "ts_up_ccf")
FILE_TYPE=3 FILE_TYPE=3
send_msg "请发送需要上传的配置文件,必须是【.${config_type}】格式,支持自定义配置文件" send_msg "$BOT_TG_SEND_CFG .${config_type} $BOT_TG_SEND_CFG_SUFFIX"
;; ;;
esac esac
} }
@@ -245,9 +249,9 @@ polling(){
"start_redir") "start_redir")
if [ "$firewall_area" = 4 ];then if [ "$firewall_area" = 4 ];then
do_start_fw do_start_fw
send_msg "已切换到$redir_mod_bf" send_msg "$BOT_TG_SWITCH_TO$redir_mod_bf"
else else
send_msg "当前已经是$redir_mod" send_msg "$BOT_TG_ALREADY$redir_mod"
fi fi
send_menu send_menu
continue continue
@@ -255,22 +259,22 @@ polling(){
"stop_redir") "stop_redir")
if [ "$firewall_area" != 4 ];then if [ "$firewall_area" != 4 ];then
do_stop_fw do_stop_fw
send_msg "已切换到纯净模式" send_msg "$BOT_TG_SWITCH_PURE"
else else
send_msg "当前已经是纯净模式!" send_msg "$BOT_TG_ALREADY_PURE"
fi fi
send_menu send_menu
continue continue
;; ;;
"restart") "restart")
do_restart do_restart
send_msg "🔄 服务已重启" send_msg "$BOT_TG_SERVICE_RESTARTED_SHORT"
sleep 10 sleep 10
send_menu send_menu
continue continue
;; ;;
"readlog") "readlog")
send_msg "📄 日志内容如下(已过滤任务日志)\n\`\`\`$(grep -v '任务' $TMPDIR/ShellCrash.log |tail -n 20)\`\`\`" send_msg "$BOT_TG_LOG_CONTENT\n\`\`\`$(grep -v "$BOT_TG_TASK_WORD" $TMPDIR/ShellCrash.log |tail -n 20)\`\`\`"
sleep 3 sleep 3
send_menu send_menu
continue continue
@@ -281,7 +285,7 @@ polling(){
;; ;;
"set_sub") "set_sub")
echo "await_sub" > "$STATE_FILE" echo "await_sub" > "$STATE_FILE"
send_msg "✏ 请输入新的订阅链接:" send_msg "$BOT_TG_INPUT_SUB"
continue continue
;; ;;
ts_*) ts_*)
@@ -297,7 +301,7 @@ polling(){
if [ "$(cat "$STATE_FILE" 2>/dev/null)" = "await_sub" ]; then if [ "$(cat "$STATE_FILE" 2>/dev/null)" = "await_sub" ]; then
echo "" > "$STATE_FILE" echo "" > "$STATE_FILE"
do_set_sub "$TEXT" do_set_sub "$TEXT"
send_msg "订阅更新完成:\n$(cat "$LOGFILE")" send_msg "$BOT_TG_SUB_UPDATED\n$(cat "$LOGFILE")"
send_menu send_menu
continue continue
fi fi
@@ -308,6 +312,9 @@ polling(){
/crash) /crash)
send_menu send_menu
;; ;;
/"$my_alias")
send_menu
;;
/help) /help)
send_help send_help
;; ;;
@@ -316,7 +323,7 @@ polling(){
done done
} }
#send_menu [ "$TG_menupush" = ON ] && send_menu
polling polling

View File

@@ -2,16 +2,18 @@
. "$CRASHDIR"/libs/web_get_lite.sh . "$CRASHDIR"/libs/web_get_lite.sh
load_lang bot_tg
private_bot() { private_bot() {
comp_box "请先通过 \033[32;4mhttps://t.me/BotFather\033[0m 申请TG机器人并获取其\033[36mAPI TOKEN\033[0m" comp_box "$BOT_TG_PRIVATE_HINT"
read -r -p "请输入你获取到的API TOKEN> " TOKEN read -r -p "$BOT_TG_INPUT_TOKEN> " TOKEN
url_tg=https://api.telegram.org/bot${TOKEN}/getUpdates url_tg=https://api.telegram.org/bot${TOKEN}/getUpdates
top_box "请向\033[32m你申请的机器人\033[33m而不是BotFather\033[0m" top_box "$BOT_TG_PRIVATE_TOP"
} }
public_bot() { public_bot() {
comp_box "请向机器人:\033[32;4mhttps://t.me/ShellCrashtg_bot\033[0m" comp_box "$BOT_TG_PUBLIC_HINT"
TOKEN=publictoken TOKEN=publictoken
url_tg=https://tgbot.jwsc.eu.org/publictoken/getUpdates url_tg=https://tgbot.jwsc.eu.org/publictoken/getUpdates
} }
@@ -20,7 +22,7 @@ tg_push_token() {
push_TG="$TOKEN" push_TG="$TOKEN"
setconfig push_TG "$TOKEN" setconfig push_TG "$TOKEN"
setconfig chat_ID "$chat_ID" setconfig chat_ID "$chat_ID"
. "$CRASHDIR"/libs/logger.sh && logger "已完成Telegram日志推送设置" 32 . "$CRASHDIR"/libs/logger.sh && logger "$BOT_TG_SET_DONE" 32
} }
get_chatid() { get_chatid() {
@@ -28,7 +30,7 @@ get_chatid() {
chat_ID='' chat_ID=''
while [ $i -le 3 ] && [ -z "$chat_ID" ]; do while [ $i -le 3 ] && [ -z "$chat_ID" ]; do
sleep 1 sleep 1
comp_box "\033[33m$i 次尝试获取对话ID失败正在重试...\033[0m" comp_box "\033[33m$BOT_TG_CHATID_RETRY_PREFIX $i $BOT_TG_CHATID_RETRY_SUFFIX\033[0m"
chat=$(web_get_lite "$url_tg" 2>/dev/null) chat=$(web_get_lite "$url_tg" 2>/dev/null)
if [ -n "$chat" ]; then if [ -n "$chat" ]; then
chat_ID=$(echo "$chat" | sed 's/"update_id":/{\n"update_id":/g' | grep "$public_key" | head -n1 | grep -oE '"id":.*,"is_bot' | sed s'/"id"://' | sed s'/,"is_bot//') chat_ID=$(echo "$chat" | sed 's/"update_id":/{\n"update_id":/g' | grep "$public_key" | head -n1 | grep -oE '"id":.*,"is_bot' | sed s'/"id"://' | sed s'/,"is_bot//')
@@ -39,19 +41,19 @@ get_chatid() {
set_bot() { set_bot() {
public_key=$(cat /proc/sys/kernel/random/boot_id | sed 's/.*-//') public_key=$(cat /proc/sys/kernel/random/boot_id | sed 's/.*-//')
btm_box "发送此秘钥: \033[30;46m$public_key\033[0m" btm_box "$BOT_TG_SEND_KEY \033[30;46m$public_key\033[0m"
read -r -p "我已经发送完成(1/0)> " res read -r -p "$BOT_TG_SENT_CONFIRM(1/0)> " res
if [ "$res" = 1 ]; then if [ "$res" = 1 ]; then
get_chatid get_chatid
[ -z "$chat_ID" ] && [ "$TOKEN" != 'publictoken' ] && { [ -z "$chat_ID" ] && [ "$TOKEN" != 'publictoken' ] && {
comp_box "\033[31m无法获取对话ID请返回重新设置或手动输入ChatID\033[0m" \ comp_box "\033[31m$BOT_TG_CHATID_FAIL\033[0m" \
"通常访问 \033[32;4m$url_tg\033[0m \n\033[36m即可看到ChatID\033[0m" "$BOT_TG_CHATID_MANUAL_HINT \033[32;4m$url_tg\033[0m \n\033[36m$BOT_TG_CHATID_MANUAL_HINT2\033[0m"
read -r -p "请手动输入ChatID> " chat_ID read -r -p "$BOT_TG_INPUT_CHATID> " chat_ID
} }
if echo "$chat_ID" | grep -qE '^[0-9]{8,}$'; then if echo "$chat_ID" | grep -qE '^[0-9]{8,}$'; then
return 0 return 0
else else
msg_alert "\033[31m无法获取对话ID请重新配置\033[0m" msg_alert "\033[31m$BOT_TG_CHATID_RECONFIG\033[0m"
return 1 return 1
fi fi
fi fi

View File

@@ -1,18 +1,18 @@
. "$CRASHDIR"/libs/set_cron.sh . "$CRASHDIR"/libs/set_cron.sh
load_lang bot_tg
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"
} }
bot_tg_cron(){ bot_tg_cron(){
cronset 'TG_BOT守护进程' "* * * * * /bin/sh $CRASHDIR/starts/start_legacy_wd.sh bot_tg #ShellCrash-TG_BOT守护进程" cronset "$BOT_TG_CRON_NAME" "* * * * * /bin/sh $CRASHDIR/starts/start_legacy_wd.sh bot_tg #$BOT_TG_CRON_NAME"
} }

View File

@@ -1,15 +1,17 @@
#!/bin/sh #!/bin/sh
# Copyright (C) Juewuy # Copyright (C) Juewuy
load_lang check_port
check_port() { check_port() {
if [ "$1" -gt 65535 ] || [ "$1" -le 1 ]; then if [ "$1" -gt 65535 ] || [ "$1" -le 1 ]; then
msg_alert "\033[31m输入错误!请输入正确的数值(1-65535)\033[0m" msg_alert "\033[31m$CHECK_PORT_RANGE_ERR\033[0m"
return 1 return 1
elif echo "|$mix_port|$redir_port|$dns_port|$db_port|" | grep -q "|$1|"; then elif echo "|$mix_port|$redir_port|$dns_port|$db_port|" | grep -q "|$1|"; then
msg_alert "\033[31m输入错误!请不要输入重复的端口!\033[0m" msg_alert "\033[31m$CHECK_PORT_DUP_ERR\033[0m"
return 1 return 1
elif netstat -ntul | grep -q ":$1[[:space:]]"; then elif netstat -ntul | grep -q ":$1[[:space:]]"; then
msg_alert "\033[31m当前端口已被其他进程占用,请重新输入!\033[0m" msg_alert "\033[31m$CHECK_PORT_OCCUPIED_ERR\033[0m"
return 1 return 1
else else
return 0 return 0

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

@@ -1,8 +1,10 @@
#! /bin/bash #! /bin/bash
# Copyright (C) Juewuy # Copyright (C) Juewuy
load_lang ddns
ddns_menu() { ddns_menu() {
top_box "\033[30;46m欢迎使用DDNS\033[0m" top_box "\033[30;46m$DDNS_WELCOME\033[0m"
load_ddns load_ddns
} }
@@ -28,41 +30,36 @@ config service '$service'
EOF EOF
/usr/lib/ddns/dynamic_dns_updater.sh -S "$service" start >/dev/null 2>&1 & /usr/lib/ddns/dynamic_dns_updater.sh -S "$service" start >/dev/null 2>&1 &
sleep 3 sleep 3
msg_alert "服务已经添加!" msg_alert "$DDNS_ADD_DONE"
} }
set_ddns() { set_ddns() {
while true; do while true; do
line_break line_break
read -r -p "请输入你的域名> " str read -r -p "$DDNS_INPUT_DOMAIN> " str
[ -z "$str" ] && domain="$domain" || domain="$str" [ -z "$str" ] && domain="$domain" || domain="$str"
echo "" echo ""
read -r -p "请输入用户名或邮箱> " str read -r -p "$DDNS_INPUT_USER> " str
[ -z "$str" ] && username="$username" || username="$str" [ -z "$str" ] && username="$username" || username="$str"
echo "" echo ""
read -r -p "请输入密码或令牌秘钥> " str read -r -p "$DDNS_INPUT_PASS> " str
[ -z "$str" ] && password="$password" || password="$str" [ -z "$str" ] && password="$password" || password="$str"
echo "" echo ""
read -r -p "请输入检测更新间隔(单位:分钟默认为10)> " check_interval read -r -p "$DDNS_INPUT_CHECK_INTERVAL> " check_interval
[ -z "$check_interval" ] || [ "$check_interval" -lt 1 -o "$check_interval" -gt 1440 ] && check_interval=10 [ -z "$check_interval" ] || [ "$check_interval" -lt 1 -o "$check_interval" -gt 1440 ] && check_interval=10
echo "" echo ""
read -r -p "请输入强制更新间隔(单位:小时默认为24)> " force_interval read -r -p "$DDNS_INPUT_FORCE_INTERVAL> " 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 "$DDNS_CONFIRM_INFO" \
separator_line "=" "" \
content_line "请核对如下信息:" "$DDNS_FIELD_SERVICE \033[32m$service\033[0m" \
content_line "" "$DDNS_FIELD_DOMAIN \033[32m$domain\033[0m" \
content_line "服务商: \033[32m$service\033[0m" "$DDNS_FIELD_USER \033[32m$username\033[0m" \
content_line "域名: \033[32m$domain\033[0m" "$DDNS_FIELD_INTERVAL \033[32m$check_interval\033[0m"
content_line "用户名: \033[32m$username\033[0m" btm_box "$DDNS_CONFIRM_ADD"
content_line "检测间隔: \033[32m$check_interval\033[0m" btm_box "1) $DDNS_YES" \
separator_line "=" "0) $DDNS_REINPUT"
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,40 +71,42 @@ 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
comp_box "\033[32m请选择服务提供商\033[0m" [ -s "$services_dir" ] || {
msg_alert "\033[33m$DDNS_LIST_NOT_FOUND\033[0m"
ddns service update >/dev/null || msg_alert "\033[31m$DDNS_DOWNLOAD_FAILED\033[0m"
}
comp_box "\033[32m$DDNS_SELECT_PROVIDER\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 "$COMMON_INPUT> " 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
else else
msg_alert "\033[33m输入错误,请重新输入!\033[0m" msg_alert "\033[33m$DDNS_INPUT_ERROR\033[0m"
fi fi
done done
} }
set_ddns_type() { set_ddns_type() {
while true; do while true; do
comp_box "\033[32m请选择网络模式:\033[0m" comp_box "\033[32m$DDNS_SELECT_NETMODE\033[0m"
content_line "1) \033[36mIPV4\033[0m" btm_box "1) \033[36m$DDNS_IPV4\033[0m" \
content_line "2) \033[36mIPV6\033[0m" "2) \033[36m$DDNS_IPV6\033[0m" \
content_line "" "" \
common_back "0) $COMMON_BACK"
read -r -p "请输入对应数字> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -125,7 +124,7 @@ set_ddns_type() {
break break
;; ;;
*) *)
msg_alert "\033[33m输入错误,请重新输入!\033[0m" msg_alert "\033[33m$DDNS_INPUT_ERROR\033[0m"
;; ;;
esac esac
done done
@@ -134,18 +133,15 @@ set_ddns_type() {
rev_ddns_service() { 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="$DDNS_DISABLE" || enabled_b="$DDNS_ENABLE"
line_break comp_box "1) \033[32m$DDNS_UPDATE_NOW\033[0m" \
separator_line "=" "2) $DDNS_EDIT_CURRENT" \
content_line "1) \033[32m立即更新\033[0m" "3) $enabled_b$DDNS_CURRENT_SERVICE" \
content_line "2) 编辑当前服务" "4) $DDNS_REMOVE_CURRENT" \
content_line "3) $enabled_b当前服务" "5) $DDNS_VIEW_LOG" \
content_line "4) 移除当前服务" "" \
content_line "5) 查看运行日志" "0) $COMMON_BACK"
content_line "" read -r -p "$COMMON_INPUT> " num
content_line "0) 返回上级菜单"
separator_line "="
read -r -p "请输入对应数字> " num
case "$num" in case "$num" in
"" | 0) "" | 0)
break break
@@ -176,15 +172,13 @@ 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
;; ;;
*) *)
msg_alert "\033[33m输入错误,请重新输入!\033[0m" msg_alert "\033[33m$DDNS_INPUT_ERROR\033[0m"
;; ;;
esac esac
done done
@@ -195,14 +189,14 @@ load_ddns() {
ddns_dir=/etc/config/ddns ddns_dir=/etc/config/ddns
tmp_dir="$TMPDIR"/ddns tmp_dir="$TMPDIR"/ddns
[ ! -f "$ddns_dir" ] && { [ ! -f "$ddns_dir" ] && {
btm_box "\033[31m本脚本依赖OpenWrt内置的DDNS服务,当前设备无法运行,已退出!\033[0m" btm_box "\033[31m$DDNS_NOT_SUPPORTED\033[0m"
sleep 1 sleep 1
return 1 return 1
} }
nr=0 nr=0
cat "$ddns_dir" | grep 'config service' | awk '{print $3}' | sed "s/'//g" | sed 's/"//g' >"$tmp_dir" cat "$ddns_dir" | grep 'config service' | awk '{print $3}' | sed "s/'//g" | sed 's/"//g' >"$tmp_dir"
separator_line "=" separator_line "="
content_line " 列表 域名 启用 IP地址" content_line "$DDNS_LIST_HEADER"
content_line "" content_line ""
[ -s "$tmp_dir" ] && for service in $(cat "$tmp_dir"); do [ -s "$tmp_dir" ] && for service in $(cat "$tmp_dir"); do
# echo $service >>$tmp_dir # echo $service >>$tmp_dir
@@ -212,10 +206,10 @@ load_ddns() {
local_ip=$(sed '1!G;h;$!d' /var/log/ddns/"$service".log 2>/dev/null | grep -E 'Registered IP' | tail -1 | awk -F "'" '{print $2}' | tr -d "'\"") local_ip=$(sed '1!G;h;$!d' /var/log/ddns/"$service".log 2>/dev/null | grep -E 'Registered IP' | tail -1 | awk -F "'" '{print $2}' | tr -d "'\"")
content_line "$nr) $domain $enabled $local_ip" content_line "$nr) $domain $enabled $local_ip"
done done
content_line "$((nr + 1))) 添加DDNS服务" content_line "$((nr + 1))) $DDNS_ADD_SERVICE"
content_line "0) 退出" content_line "0) $DDNS_EXIT"
separator_line "=" separator_line "="
read -r -p "请输入对应序号> " num read -r -p "$DDNS_INPUT_INDEX> " num
if [ -z "$num" ] || [ "$num" = 0 ]; then if [ -z "$num" ] || [ "$num" = 0 ]; then
i= i=
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
@@ -226,7 +220,7 @@ load_ddns() {
service=$(cat "$tmp_dir" | sed -n "$num"p) service=$(cat "$tmp_dir" | sed -n "$num"p)
rev_ddns_service rev_ddns_service
else else
msg_alert "\033[33m请输入正确数字!\033[0m" msg_alert "\033[33m$DDNS_INPUT_NUM_ERROR\033[0m"
fi fi
done done
} }

View File

@@ -12,14 +12,11 @@ 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 "1) $DNS_SET_TO MIX$COMMON_MOD\t\033[32m$DNS_MODE_MIX_DESC\033[0m"
content_line "\033[33m$DNS_RESTART_NOTICE\033[0m" content_line "2) $DNS_SET_TO Route$COMMON_MOD\t\033[32m$DNS_MODE_ROUTE_DESC\033[0m"
separator_line "=" content_line "3) $DNS_SET_TO Redir$COMMON_MOD\t\033[33m$DNS_MODE_REDIR_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 "3) 设为Redir$COMMON_MOD\t\033[33m$DNS_MODE_REDIR_DESC\033[0m"
content_line "" content_line ""
content_line "4) $DNS_MENU_PROTECT\t \033[36m$dns_protect\033[0m\t$DNS_PROTECT_DESC" content_line "4) $DNS_MENU_PROTECT\t \033[36m$dns_protect\033[0m\t$DNS_PROTECT_DESC"
content_line "5) $DNS_MENU_HOSTS\t \033[36m$hosts_opt\033[0m\t$DNS_HOSTS_DESC" content_line "5) $DNS_MENU_HOSTS\t \033[36m$hosts_opt\033[0m\t$DNS_HOSTS_DESC"
@@ -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 "$DNS_PROTECT_NOW\033[33m$DNS_ENABLED\033[0m$DNS_PROTECT_DISABLE_Q"
else else
content_line "当前\033[33m已禁用\033[0mDNS防泄漏是否确认启用" content_line "$DNS_PROTECT_NOW\033[33m$DNS_DISABLED\033[0m$DNS_PROTECT_ENABLE_Q"
fi fi
separator_line "=" separator_line "="
content_line "1) 是" btm_box "1) $DNS_YES" \
content_line "2) 重置为默认值" "2) $DNS_RESET_DEFAULT" \
content_line "0) 否,返回上级菜单" "0) $DNS_NO_BACK"
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 "$DNS_HOSTS_NOW\033[33m$DNS_ENABLED\033[0m$DNS_HOSTS_DISABLE_Q"
else else
content_line "当前\033[33m已禁用\033[0mHosts优化是否确认启用" content_line "$DNS_HOSTS_NOW\033[33m$DNS_DISABLED\033[0m$DNS_HOSTS_ENABLE_Q"
fi fi
separator_line "=" separator_line "="
content_line "1) 是" btm_box "1) $DNS_YES" \
content_line "2) 重置为默认值" "2) $DNS_RESET_DEFAULT" \
content_line "0) 否,返回上级菜单" "0) $DNS_NO_BACK"
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 "$DNS_HOSTS_NOW\033[33m$DNS_ENABLED\033[0m$DNS_HOSTS_DISABLE_Q"
else else
content_line "当前\033[33m已禁用\033[0mHosts优化是否确认启用" content_line "$DNS_HOSTS_NOW\033[33m$DNS_DISABLED\033[0m$DNS_HOSTS_ENABLE_Q"
fi fi
separator_line "=" separator_line "="
content_line "1) 是" btm_box "1) $DNS_YES" \
content_line "2) 重置为默认值" "2) $DNS_RESET_DEFAULT" \
content_line "0) 否,返回上级菜单" "0) $DNS_NO_BACK"
separator_line "="
read -r -p "$COMMON_INPUT> " num read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
0) 0)
@@ -177,31 +152,22 @@ 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$DNS_INPUT_REDIR_PORT\033[0m" \
content_line "" "$DNS_INPUT_REDIR_RESET" \
content_line "请直接输入旁路由IPV4地址" "$DNS_INPUT_REDIR_BACK"
content_line "或输入 r 重置DNS劫持端口" read -r -p "$DNS_INPUT> " num
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " num
case "$num" in case "$num" in
0) 0)
break break
@@ -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) $COMMON_BACK"
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$DNS_REMOVE_OK\033[0m"
else else
content_line "\033[31m移除失败\033[0m" msg_alert "\033[31m$DNS_REMOVE_FAIL\033[0m"
fi fi
else else
content_line "请确认需要添加的地址:\033[32m$input\033[0m" comp_box "$DNS_CONFIRM_ADD\033[32m$input\033[0m"
separator_line "=" btm_box "1) $DNS_CONFIRM_OK" \
content_line "1) 确认无误" "0) $COMMON_BACK"
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$DNS_ADD_OK\033[0m"
else else
content_line "\033[31m添加失败\033[0m" msg_alert "\033[31m$DNS_ADD_FAIL\033[0m"
fi fi
else else
break break
fi fi
fi fi
separator_line "="
sleep 1
;; ;;
esac esac
done done
@@ -320,47 +260,37 @@ 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 "$DNS_DIRECT_NOW\033[32m$dns_nameserver\033[0m"
separator_line "=" btm_box "\033[36m$DNS_INPUT_DIRECT_NEW\033[0m" \
content_line "当前DIRECT-DNS\033[32m$dns_nameserver\033[0m" "$DNS_INPUT_DIRECT_RESET" \
separator_line "=" "$DNS_INPUT_REDIR_BACK"
content_line "请直接输入新的DIRECT-DNS地址" read -r -p "$DNS_INPUT> " res
content_line "或输入 r 重置DIRECT-DNS地址"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " res
case "$res" in case "$res" in
0) 0)
continue continue
@@ -368,35 +298,25 @@ 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 "$DNS_PROXY_NOW\033[32m$dns_fallback\033[0m"
separator_line "=" btm_box "\033[36m$DNS_INPUT_PROXY_NEW\033[0m" \
content_line "当前PROXY-DNS\033[32m$dns_fallback\033[0m" "$DNS_INPUT_PROXY_RESET" \
separator_line "=" "$DNS_INPUT_REDIR_BACK"
content_line "请直接输入新的PROXY-DNS地址" read -r -p "$DNS_INPUT> " res
content_line "或输入 r 重置PROXY-DNS地址"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " res
case "$res" in case "$res" in
0) 0)
continue continue
@@ -404,34 +324,26 @@ 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 "$DNS_DEFAULT_NOW\033[32m$dns_resolver\033[0m"
btm_box "\033[36m$DNS_INPUT_DEFAULT_NEW\033[0m" \
"$DNS_INPUT_DEFAULT_RESET" \
"$DNS_INPUT_REDIR_BACK"
separator_line "=" separator_line "="
content_line "当前DEFAULT-DNS\033[32m$dns_resolver\033[0m" read -r -p "$DNS_INPUT> " res
separator_line "="
content_line "请直接输入新的DEFAULT-DNS地址"
content_line "或输入 r 重置DEFAULT-DNS地址"
content_line "或输入 0 返回上级菜单"
separator_line "="
read -r -p "请输入> " res
case "$res" in case "$res" in
0) 0)
continue continue
@@ -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

@@ -4,6 +4,8 @@
[ -n "$__IS_MODULE_PROVIDERS" ] && return [ -n "$__IS_MODULE_PROVIDERS" ] && return
__IS_MODULE_PROVIDERS=1 __IS_MODULE_PROVIDERS=1
load_lang providers
if [ "$crashcore" = singboxr ]; then if [ "$crashcore" = singboxr ]; then
CORE_TYPE=singbox CORE_TYPE=singbox
else else
@@ -14,77 +16,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$PROVIDERS_MENU_GEN\033[0m" \
content_line "2) 选择\033[33m规则模版\033[0m \033[32m$provider_temp_des\033[0m" "2) $PROVIDERS_MENU_TEMPLATE \033[32m$provider_temp_des\033[0m" \
content_line "3) \033[33m清理\033[0mproviders目录文件" "3) $PROVIDERS_MENU_CLEAN" \
separator_line "-" "" \
common_back "0) $COMMON_BACK"
read -p "请输入对应字母或数字 > " num read -r -p "$PROVIDERS_INPUT> " 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$PROVIDERS_EMPTY_HINT\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 "$PROVIDERS_TEMPLATE_CURRENT\033[32m$provider_temp_des\033[0m" \
content_line "\033[33m请选择在线模版:\033[0m" "\033[33m$PROVIDERS_TEMPLATE_SELECT\033[0m"
separator_line "-"
list_box "$list" list_box "$list"
separator_line "-" btm_box "" \
content_line "a) 使用\033[36m本地模版\033[0m" "a) $PROVIDERS_TEMPLATE_LOCAL" \
common_back "" \
read -p "请输入对应字母或数字 > " num "0) $COMMON_BACK"
read -r -p "$PROVIDERS_INPUT> " num
case "$num" in case "$num" in
"" | 0) ;; "" | 0) ;;
a) a)
read -p "请输入模版的路径(绝对路径) > " dir line_break
if [ -s $dir ]; then read -r -p "$PROVIDERS_TEMPLATE_PATH> " 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$PROVIDERS_TEMPLATE_NOT_FOUND\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$PROVIDERS_CLEAN_WARN $CRASHDIR/providers $PROVIDERS_CLEAN_WARN_END\033[0m" \
read -p "是否继续?(1/0) > " res "" \
[ "$res" = "1" ] && rm -rf "$CRASHDIR"/providers && common_success "$PROVIDERS_CLEAN_CONFIRM"
btm_box "1) $PROVIDERS_YES" \
"0) $PROVIDERS_NO"
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

@@ -4,80 +4,85 @@
[ -n "$__IS_PROVIDERS_CLASH" ] && return [ -n "$__IS_PROVIDERS_CLASH" ] && return
__IS_PROVIDERS_CLASH=1 __IS_PROVIDERS_CLASH=1
load_lang providers
. "$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$PROVIDERS_FETCHING_TEMPLATE\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$PROVIDERS_DOWNLOAD_FAILED\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$PROVIDERS_GEN_OK\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 "$PROVIDERS_RESTART_ASK"
btm_box "1) $PROVIDERS_YES" \
"0) $PROVIDERS_NO"
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 "$PROVIDERS_CRON_SUB_UPDATE"
exit exit
} }
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$PROVIDERS_GEN_FAILED\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 +98,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 +112,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 +122,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

@@ -4,85 +4,89 @@
[ -n "$__IS_PROVIDERS_SINGBOX" ] && return [ -n "$__IS_PROVIDERS_SINGBOX" ] && return
__IS_PROVIDERS_SINGBOX=1 __IS_PROVIDERS_SINGBOX=1
load_lang providers
. "$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$PROVIDERS_FETCHING_TEMPLATE\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$PROVIDERS_DOWNLOAD_FAILED\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$PROVIDERS_GEN_OK_SINGBOX\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 "$PROVIDERS_RESTART_ASK"
btm_box "1) $PROVIDERS_YES" \
"0) $PROVIDERS_NO"
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 "$PROVIDERS_CRON_SUB_UPDATE"
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$PROVIDERS_GEN_FAILED\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 +95,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 +115,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 +130,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,44 @@
#!/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
if [ -n "$CRASHDIR" ] && [ -s "$CRASHDIR/libs/i18n.sh" ]; then
. "$CRASHDIR/libs/i18n.sh"
load_lang set_crashdir
elif [ -n "$language" ] && [ -s "/tmp/SC_tmp/lang/$language/set_crashdir.lang" ]; then
. "/tmp/SC_tmp/lang/$language/set_crashdir.lang"
fi
cecho() {
printf '%b\n' "$*"
}
set_usb_dir() { set_usb_dir() {
while true; do while true; do
cecho "请选择安装目录" comp_box "$SCD_SELECT_INSTALL_DIR"
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 "$SCD_INPUT_NUM> " 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$SCD_INPUT_ERROR\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$SCD_XIAOMI_DETECTED\033[0m"
[ -d /data ] && cecho " 1 安装到 /data 目录,剩余空间:$(dir_avail /data -h)(支持软固化功能)" [ -d /data ] && content_line "1) /data$SCD_DIR_FREE$(dir_avail /data -h) $SCD_SOFT_SOLID"
[ -d /userdisk ] && cecho " 2 安装到 /userdisk 目录,剩余空间:$(dir_avail /userdisk -h)(支持软固化功能)" [ -d /userdisk ] && content_line "2) /userdisk$SCD_DIR_FREE$(dir_avail /userdisk -h) $SCD_SOFT_SOLID"
[ -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$SCD_DIR_FREE$(dir_avail /data/other_vol -h) $SCD_SOFT_SOLID"
cecho " 4 安装到自定义目录(不推荐,不明勿用!)" content_line "4) $SCD_CUSTOM_DIR_WARN"
cecho " 0 退出安装" content_line ""
echo "-----------------------------------------------" content_line "0) $SCD_EXIT_INSTALL"
read -p "请输入相应数字 > " num separator_line "="
read -r -p "$SCD_INPUT_NUM> " num
case "$num" in case "$num" in
1) 1)
dir=/data dir=/data
@@ -42,56 +53,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 "$SCD_SELECT_USB_DIR"
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 "$SCD_INPUT_NUM> " 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$SCD_ASUS_DM_NOT_FOUND $dir/asusware.arm/etc/init.d/S50downloadmaster$SCD_CHECK_SETTING\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$SCD_ASUS_DETECTED\033[0m" \
cecho " 2 基于自启脚本安装(仅支持部分梅林固件)" "1) $SCD_ASUS_INSTALL_DM" \
cecho " 0 退出安装" "2) $SCD_ASUS_INSTALL_SCRIPT" \
echo "-----------------------------------------------" "" \
read -p "请输入相应数字 > " num "0) $SCD_EXIT_INSTALL"
read -r -p "$SCD_INPUT_NUM> " num
case "$num" in case "$num" in
1) 1)
echo -e "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!" msg_alert -t 2 "$SCD_ASUS_DM_HINT"
sleep 2
set_asus_usb set_asus_usb
;; ;;
2) 2)
cecho "如开机无法正常自启请重新使用U盘+下载大师安装!" msg_alert -t 2 "$SCD_ASUS_REINSTALL_HINT"
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 "$SCD_PATH_FORMAT_HINT" \
echo '可用路径 剩余空间:' "" \
df -h | awk '{print $6,$4}' | sed 1d "$SCD_PATH_FREE_SPACE"
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 "$SCD_INPUT_CUSTOM_DIR> " 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$SCD_PATH_ERROR\033[0m"
continue continue
fi fi
break 1 break 1
@@ -100,22 +125,30 @@ set_cust_dir() {
set_crashdir() { set_crashdir() {
while true; do while true; do
echo "-----------------------------------------------" top_box "\033[33m$SCD_INSTALL_SPACE_HINT\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) $SCD_INSTALL_ETC" \
cecho " 3 在\033[32m当前用户目录\033[0m下安装(适合非root用户)" "2) $SCD_INSTALL_USR" \
cecho " 4 在\033[32m外置存储\033[0m中安装" "3) $SCD_INSTALL_HOME" \
cecho " 5 手动设置安装目录" "4) $SCD_INSTALL_USB" \
cecho " 0 退出安装" "5) $SCD_INSTALL_MANUAL" \
echo "----------------------------------------------" "" \
read -p "请输入相应数字 > " num "0) $SCD_EXIT_INSTALL"
read -r -p "$SCD_INPUT_NUM> " num
# 设置目录 # 设置目录
case "$num" in case "$num" in
1) 1)
@@ -135,7 +168,8 @@ set_crashdir() {
set_cust_dir set_cust_dir
;; ;;
*) *)
echo "安装已取消" msg_alert "$SCD_INSTALL_CANCELED"
line_break
exit 1 exit 1
;; ;;
esac esac
@@ -143,11 +177,14 @@ set_crashdir() {
esac esac
if [ ! -w "$dir" ]; then if [ ! -w "$dir" ]; then
cecho "\033[31m没有$dir目录写入权限!请重新设置!\033[0m" msg_alert "\033[31m$SCD_NO_WRITE_PREFIX$dir$SCD_NO_WRITE_SUFFIX\033[0m"
sleep 1
else else
cecho "目标目录\033[32m$dir\033[0m空间剩余$(dir_avail "$dir" -h)" comp_box "$SCD_TARGET_DIR_PREFIX\033[32m$dir\033[0m$SCD_TARGET_DIR_SPACE$(dir_avail "$dir" -h)" \
read -p "确认安装?(1/0) > " res "" \
"$SCD_CONFIRM_INSTALL"
btm_box "1) $SCD_YES" \
"0) $SCD_NO"
read -r -p "$SCD_INPUT_NUM> " res
if [ "$res" = "1" ]; then if [ "$res" = "1" ]; then
CRASHDIR="$dir"/ShellCrash CRASHDIR="$dir"/ShellCrash
break break

View File

@@ -7,26 +7,28 @@ __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在线订阅转换 load_lang subconverter
# Subconverter在线订阅转换
subconverter() { subconverter() {
while true; do while true; do
separator_line "-" comp_box "1) \033[32m$SUBCONVERTER_MENU_GEN\033[0m"\
content_line "1) \033[32m生成\033[0m包含全部节点/订阅的配置文件" "2) $SUBCONVERTER_MENU_EXCLUDE \033[47;30m$exclude\033[0m"\
content_line "2) 设置\033[31m排除节点正则\033[0m \033[47;30m$exclude\033[0m" "3) $SUBCONVERTER_MENU_INCLUDE \033[47;30m$include\033[0m"\
content_line "3) 设置\033[32m包含节点正则\033[0m \033[47;30m$include\033[0m" "4) $SUBCONVERTER_MENU_RULE"\
content_line "4) 选择\033[33m在线规则模版\033[0m" "5) $SUBCONVERTER_MENU_SERVER"\
content_line "5) 选择\033[0mSubconverter服务器\033[0m" "6) $SUBCONVERTER_MENU_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 "$COMMON_INPUT> " 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 +52,136 @@ subconverter() {
;; ;;
*) *)
errornum errornum
break
;; ;;
esac esac
done done
} }
gen_link_flt() { # 排除节点正则 # 排除节点正则
[ -z "$exclude" ] && exclude="未设置" gen_link_flt() {
separator_line "-" comp_box "\033[33m$SUBCONVERTER_EXCLUDE_HINT1\033[0m" \
content_line "\033[33m当前过滤关键字\033[47;30m$exclude\033[0m" "$SUBCONVERTER_KEYWORD_SPLIT" \
separator_line "-" "$SUBCONVERTER_REGEX_HINT"
content_line "\033[33m匹配关键字的节点会在导入时被【屏蔽】\033[0m" btm_box "\033[36m$SUBCONVERTER_EXCLUDE_INPUT\033[0m" \
content_line "多个关键字可以用\033[30;47m | \033[0m号分隔" "$SUBCONVERTER_EXCLUDE_CLEAR" \
content_line "\033[32m支持正则表达式\033[0m空格请使用\033[30;47m + \033[0m号替代" "$SUBCONVERTER_BACK"
separator_line "-" read -r -p "$SUBCONVERTER_INPUT> " 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$SUBCONVERTER_INCLUDE_HINT1\033[0m" \
content_line "\033[33m当前筛选关键字\033[47;30m$include\033[0m" "$SUBCONVERTER_KEYWORD_SPLIT" \
separator_line "-" "$SUBCONVERTER_REGEX_HINT"
content_line "\033[33m仅有匹配关键字的节点才会被【导入】\033[0m" btm_box "\033[36m$SUBCONVERTER_INCLUDE_INPUT\033[0m" \
content_line "多个关键字可以用\033[30;47m | \033[0m号分隔" "$SUBCONVERTER_INCLUDE_CLEAR" \
content_line "\033[32m支持正则表达式\033[0m空格请使用\033[30;47m + \033[0m号替代" "$SUBCONVERTER_BACK"
separator_line "-" read -r -p "$SUBCONVERTER_INPUT> " 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 "$SUBCONVERTER_RULE_CURRENT\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 "$COMMON_INPUT> " 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$SUBCONVERTER_SET_OK\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$SUBCONVERTER_SERVER_HINT\033[0m" \
content_line "\033[32m感谢以下作者的无私奉献!!!\033[0m" "\033[32m$SUBCONVERTER_SERVER_THANKS\033[0m" \
content_line "当前使用后端为:\033[33m$now\033[0m" "" \
separator_line "-" "$SUBCONVERTER_SERVER_CURRENT\033[33m$now\033[0m"
list_box "$list" list_box "$list"
content_line ""
common_back common_back
read -r -p "请输入对应数字 > " num read -r -p "$COMMON_INPUT> " 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$SUBCONVERTER_SET_OK\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$SUBCONVERTER_UA_HINT\033[0m" \
content_line " 1 使用自动UA(默认)" "" \
content_line " 2 不使用UA" "$SUBCONVERTER_UA_CURRENT$user_agent"
content_line " 3 使用自定义UA\033[32m$user_agent\033[0m" btm_box "1) $SUBCONVERTER_UA_AUTO"\
separator_line "-" "2) $SUBCONVERTER_UA_NONE"\
read -r -p "请输入对应数字 > " num "3) $SUBCONVERTER_UA_CUSTOM"\
"4) $SUBCONVERTER_UA_CLEAR"\
""\
"0) $COMMON_BACK"
read -r -p "$COMMON_INPUT> " num
case "$num" in case "$num" in
0) 0)
user_agent='' break
;; ;;
1) 1)
user_agent='auto' user_agent='auto'
@@ -166,12 +190,32 @@ set_sub_ua() {
user_agent='none' user_agent='none'
;; ;;
3) 3)
read -r -p "请输入自定义UA(不要包含空格和特殊符号!) > " text comp_box "\033[33m$SUBCONVERTER_UA_CUSTOM_WARN\033[0m"
[ -n "$text" ] && user_agent="$text" btm_box "\033[36m$SUBCONVERTER_UA_CUSTOM_INPUT\033[0m" \
"$SUBCONVERTER_BACK"
read -r -p "$SUBCONVERTER_INPUT> " 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

@@ -9,12 +9,19 @@
. "$CRASHDIR"/libs/set_config.sh . "$CRASHDIR"/libs/set_config.sh
. "$CRASHDIR"/libs/web_get_bin.sh . "$CRASHDIR"/libs/web_get_bin.sh
. "$CRASHDIR"/libs/logger.sh . "$CRASHDIR"/libs/logger.sh
. "$CRASHDIR"/libs/i18n.sh
load_lang task_cmd
task_logger(){ 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 "($TASK_CMD_EVERY|$TASK_CMD_HOURLY)([1-9]|[1-9][0-9])$TASK_CMD_MIN" && {
push=off
cover=on
}
logger "$1" 0 "$push" "$cover"
} }
#任务命令 #任务命令
@@ -28,22 +35,22 @@ update_core(){ #自动更新内核
check_update bin/version check_update bin/version
crash_v_new=$(eval echo \$${crashcore}_v) crash_v_new=$(eval echo \$${crashcore}_v)
if [ -z "$crash_v_new" -o "$crash_v_new" = "$core_v" ];then if [ -z "$crash_v_new" -o "$crash_v_new" = "$core_v" ];then
task_logger "任务【自动更新内核】中止-未检测到版本更新" task_logger "$TASK_CMD_CORE_SKIP"
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 "$TASK_CMD_CORE_DONE"
"$CRASHDIR"/start.sh start "$CRASHDIR"/start.sh start
return 0 return 0
;; ;;
1) 1)
task_logger "任务【自动更新内核】出错-下载失败!" task_logger "$TASK_CMD_CORE_DL_FAIL"
return 1 return 1
;; ;;
*) *)
task_logger "任务【自动更新内核】出错-内核校验失败!" task_logger "$TASK_CMD_CORE_VERIFY_FAIL"
"$CRASHDIR"/start.sh start "$CRASHDIR"/start.sh start
return 1 return 1
;; ;;
@@ -54,22 +61,22 @@ update_scripts(){ #自动更新脚本
#检查版本 #检查版本
check_update version check_update version
if [ -z "$versionsh" -o "$versionsh" = "versionsh_l" ];then if [ -z "$versionsh" -o "$versionsh" = "versionsh_l" ];then
task_logger "任务【自动更新脚本】中止-未检测到版本更新" task_logger "$TASK_CMD_SCRIPT_SKIP"
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 "$TASK_CMD_CORE_DL_FAIL"
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 "$TASK_CMD_SCRIPT_UNZIP_FAIL"
"$CRASHDIR"/start.sh start "$CRASHDIR"/start.sh start
return 1 return 1
else else
@@ -88,17 +95,17 @@ update_mmdb(){ #自动更新数据库
geo_v_new=$GeoIP_v geo_v_new=$GeoIP_v
geo_v_now=$(eval echo \$$geo_v) geo_v_now=$(eval echo \$$geo_v)
if [ -z "$geo_v_new" -o "$geo_v_new" = "$geo_v_now" ];then if [ -z "$geo_v_new" -o "$geo_v_new" = "$geo_v_now" ];then
task_logger "任务【自动更新数据库文件】跳过-未检测到$2版本更新" task_logger "$TASK_CMD_DB_SKIP_PREFIX$2$TASK_CMD_DB_SKIP_SUFFIX"
else else
#更新文件 #更新文件
get_bin "$TMPDIR"/$1 "bin/geodata/$2" get_bin "$TMPDIR"/$1 "bin/geodata/$2"
if [ "$?" != "0" ];then if [ "$?" != "0" ];then
task_logger "任务【自动更新数据库文件】更新【$2】下载失败!" task_logger "$TASK_CMD_DB_DL_FAIL_PREFIX$2$TASK_CMD_DB_DL_FAIL_SUFFIX"
rm -rf "$TMPDIR"/$1 rm -rf "$TMPDIR"/$1
else else
mv -f "$TMPDIR"/$1 "$BINDIR"/$1 mv -f "$TMPDIR"/$1 "$BINDIR"/$1
setconfig $geo_v $GeoIP_v setconfig $geo_v $GeoIP_v
task_logger "任务【自动更新数据库文件】更新【$2】成功!" task_logger "$TASK_CMD_DB_OK_PREFIX$2$TASK_CMD_DB_OK_SUFFIX"
fi fi
fi fi
} }
@@ -115,7 +122,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
@@ -136,8 +143,8 @@ case "$1" in
task_command=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$1" | awk -F '#' '{print $2}') task_command=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$1" | awk -F '#' '{print $2}')
task_name=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$1" | awk -F '#' '{print $3}') task_name=$(cat "$CRASHDIR"/task/task.list "$CRASHDIR"/task/task.user 2>/dev/null | grep "$1" | awk -F '#' '{print $3}')
#task_logger "任务$task_name 开始执行" #task_logger "任务$task_name 开始执行"
eval $task_command && task_res=成功 || task_res=失败 eval $task_command && task_res="$TASK_CMD_RES_OK" || task_res="$TASK_CMD_RES_FAIL"
task_logger "任务【$2】执行$task_res" task_logger "$TASK_CMD_EXEC_PREFIX$2$TASK_CMD_EXEC_MID$task_res"
;; ;;
*) *)
"$1" "$1"

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

@@ -1,29 +1,28 @@
#!/bin/sh #!/bin/sh
# Copyright (C) Juewuy # Copyright (C) Juewuy
load_lang uninstall
# 卸载 # 卸载
uninstall() { uninstall() {
comp_box "\033[31m警告:\033[0m" \ comp_box "\033[31m$UNINSTALL_WARN\033[0m" \
"\033[31m该操作不可逆\033" \ "$UNINSTALL_CONFIRM"
"是否确认卸载ShellCrash" btm_box "1) $UNINSTALL_YES" \
content_line "1) 是" "0) $UNINSTALL_NO"
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 2>/dev/null "$CRASHDIR"/start.sh stop 2>/dev/null
"$CRASHDIR"/start.sh cronset "clash服务" 2>/dev/null "$CRASHDIR"/start.sh cronset "$UNINSTALL_CRON_CLASH" 2>/dev/null
"$CRASHDIR"/start.sh cronset "订阅链接" 2>/dev/null "$CRASHDIR"/start.sh cronset "$UNINSTALL_CRON_SUB" 2>/dev/null
"$CRASHDIR"/start.sh cronset "ShellCrash初始化" 2>/dev/null "$CRASHDIR"/start.sh cronset "$UNINSTALL_CRON_INIT" 2>/dev/null
"$CRASHDIR"/start.sh cronset "task.sh" 2>/dev/null "$CRASHDIR"/start.sh cronset "task.sh" 2>/dev/null
# 移除安装目录 # 移除安装目录
if [ -n "$CRASHDIR" ] && [ "$CRASHDIR" != '/' ]; then if [ -n "$CRASHDIR" ] && [ "$CRASHDIR" != '/' ]; then
comp_box "是否保留脚本配置及订阅文件:" comp_box "$UNINSTALL_KEEP_CONFIRM"
content_line "1) 是" btm_box "1) $UNINSTALL_YES" \
content_line "0) " "0) $UNINSTALL_NO"
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
@@ -37,7 +36,7 @@ uninstall() {
rm -rf "$CRASHDIR" rm -rf "$CRASHDIR"
fi fi
else else
msg_alert "\033[31m环境变量配置有误,请尝试手动移除安装目录!\033[0m" msg_alert "\033[31m$UNINSTALL_ENV_ERROR\033[0m"
fi fi
# 移除其他内容 # 移除其他内容
@@ -51,9 +50,9 @@ uninstall() {
} }
sed -i '/all_proxy/'d /etc/profile 2>/dev/null sed -i '/all_proxy/'d /etc/profile 2>/dev/null
sed -i '/ALL_PROXY/'d /etc/profile 2>/dev/null sed -i '/ALL_PROXY/'d /etc/profile 2>/dev/null
sed -i "/启用外网访问SSH服务/d" /etc/firewall.user 2>/dev/null sed -i "/$UNINSTALL_SSH_MARK/d" /etc/firewall.user 2>/dev/null
sed -i '/ShellCrash初始化/'d /etc/storage/started_script.sh 2>/dev/null sed -i "/$UNINSTALL_CRON_INIT/d" /etc/storage/started_script.sh 2>/dev/null
sed -i '/ShellCrash初始化/'d /jffs/.asusrouter 2>/dev/null sed -i "/$UNINSTALL_CRON_INIT/d" /jffs/.asusrouter 2>/dev/null
[ "$BINDIR" != "$CRASHDIR" ] && rm -rf "$BINDIR" [ "$BINDIR" != "$CRASHDIR" ] && rm -rf "$BINDIR"
rm -rf /etc/init.d/shellcrash rm -rf /etc/init.d/shellcrash
rm -rf /etc/systemd/system/shellcrash.service rm -rf /etc/systemd/system/shellcrash.service
@@ -65,12 +64,12 @@ uninstall() {
userdel -r shellcrash 2>/dev/null userdel -r shellcrash 2>/dev/null
nvram set script_usbmount="" 2>/dev/null nvram set script_usbmount="" 2>/dev/null
nvram commit 2>/dev/null nvram commit 2>/dev/null
comp_box "\033[36m已卸载ShellCrash相关文件有缘再会\033[0m" \ comp_box "\033[36m$UNINSTALL_DONE\033[0m" \
"\033[33m请手动关闭当前窗口以重置环境变量!\033[0m" "\033[33m$UNINSTALL_CLOSE_HINT\033[0m"
line_break line_break
sleep 1 sleep 1
exit 0 exit 0
else else
msg_alert "\033[31m操作已取消!\033[0m" msg_alert "\033[31m$UNINSTALL_CANCELED\033[0m"
fi fi
} }

Some files were not shown because too many files have changed in this diff Show More