157 Commits

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

View File

@@ -20,6 +20,7 @@ jobs:
[ "${{ inputs.tag1 }}" = singbox ] && 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)
[ "${{ inputs.tag1 }}" = singboxr ] && latest_tag="${latest_tag}-reF1nd"
echo "version=$latest_tag" >> $GITHUB_OUTPUT
update_meta_upx:

View File

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

View File

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

Binary file not shown.

View File

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

View File

@@ -57,6 +57,7 @@ docker run -d \
--cap-add NET_ADMIN \
--cap-add NET_RAW \
--cap-add SYS_ADMIN \
--sysctl net.ipv4.ip_forward=1 \
--device /dev/net/tun:/dev/net/tun \
--restart unless-stopped \
juewuy/shellcrash:latest
@@ -87,14 +88,10 @@ mkdir -p /root/ShellCrash
```shell
docker run -d \
………………
-v /root/ShellCrash:/etc/ShellCrash \
-v shellcrash_configs:/etc/ShellCrash/configs \
………………
```
------
------
## Compose DeploymentCompose部署
@@ -102,8 +99,8 @@ docker run -d \
### 1. 创建宿主机目录并进入目录
```shell
mkdir -p /root/ShellCrash
cd /root/ShellCrash
mkdir -p /tmp/ShellCrash
cd /tmp/ShellCrash
```
### 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`
- macvlan 网络下宿主机默认无法直接访问容器 IP
- 透明代理场景可能需要额外的网络规划

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,10 @@
#DustinWin-ruleset轻量规则
proxy-groups:
- {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: 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]|低倍率|省流|大流量)"}
@@ -22,7 +22,7 @@ rule-providers:
behavior: domain
format: 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
private:
@@ -30,7 +30,7 @@ rule-providers:
behavior: domain
format: 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
tld-proxy:
@@ -38,7 +38,7 @@ rule-providers:
behavior: domain
format: 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
proxy:
@@ -46,7 +46,7 @@ rule-providers:
behavior: domain
format: 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
privateip:
@@ -54,7 +54,7 @@ rule-providers:
behavior: ipcidr
format: 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
cnip:
@@ -62,7 +62,7 @@ rule-providers:
behavior: ipcidr
format: 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
telegramip:
@@ -70,15 +70,15 @@ rule-providers:
behavior: ipcidr
format: 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
rules:
- RULE-SET,private,DIRECT
- RULE-SET,tld-proxy,🧱 代理域名
- RULE-SET,proxy,🧱 代理域名
- RULE-SET,cn,🎯 全球直连
- RULE-SET,tld-proxy,🌎 国外域名
- RULE-SET,proxy,🌎 国外域名
- RULE-SET,cn,🎯 本地直连
- RULE-SET,privateip,DIRECT,no-resolve
- RULE-SET,cnip,🎯 全球直连
- RULE-SET,cnip,🎯 本地直连
- RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼
- MATCH,🐟 漏网之鱼

View File

@@ -1,23 +1,23 @@
#DustinWin-ruleset标准规则+去广告
proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, 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: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {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: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {name: 🛑 广告域名, type: select, proxies: [🔴 全球拦截, 🟢 全球绕过]}
- {name: 🔴 全球拦截, type: select, proxies: [REJECT], 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: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -35,7 +35,7 @@ rule-providers:
behavior: domain
format: 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
ads:
@@ -43,7 +43,7 @@ rule-providers:
behavior: domain
format: 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
trackerslist:
@@ -51,7 +51,7 @@ rule-providers:
behavior: domain
format: 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
microsoft-cn:
@@ -59,7 +59,7 @@ rule-providers:
behavior: domain
format: 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
apple-cn:
@@ -67,7 +67,7 @@ rule-providers:
behavior: domain
format: 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
google-cn:
@@ -75,7 +75,7 @@ rule-providers:
behavior: domain
format: 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
games-cn:
@@ -83,7 +83,7 @@ rule-providers:
behavior: domain
format: 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
ai:
@@ -91,7 +91,7 @@ rule-providers:
behavior: domain
format: 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
networktest:
@@ -99,7 +99,7 @@ rule-providers:
behavior: domain
format: 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
proxy:
@@ -107,7 +107,7 @@ rule-providers:
behavior: domain
format: 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
cn:
@@ -115,7 +115,7 @@ rule-providers:
behavior: domain
format: 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
privateip:
@@ -123,7 +123,7 @@ rule-providers:
behavior: ipcidr
format: 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
cnip:
@@ -131,7 +131,7 @@ rule-providers:
behavior: ipcidr
format: 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
telegramip:
@@ -139,7 +139,7 @@ rule-providers:
behavior: ipcidr
format: 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
rules:
@@ -152,9 +152,9 @@ rules:
- RULE-SET,games-cn,🎮 游戏服务
- RULE-SET,ai,🤖 AI 平台
- RULE-SET,networktest,📈 网络测试
- RULE-SET,proxy,🧱 代理域名
- RULE-SET,cn,🛡️ 直连域名
- RULE-SET,proxy,🌎 国外域名
- RULE-SET,cn,🇨🇳 国内域名
- RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,cnip,🀄️ 直连 IP
- RULE-SET,cnip,🀄️ 国内 IP
- RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼
- MATCH,🐟 漏网之鱼

View File

@@ -1,20 +1,20 @@
#DustinWin-ruleset标准规则
proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, 👉 手动选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 📈 网络测试, type: select, proxies: [🎯 全球直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, 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: 🀄️ 直连 IP, type: select, proxies: [🎯 全球直连, 🚀 节点选择]}
- {name: 🧱 代理域名, type: select, proxies: [🚀 节点选择, 🎯 全球直连]}
- {name: 📈 网络测试, type: select, proxies: [🎯 本地直连, 🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🤖 AI 平台, type: select, proxies: [🚀 节点选择, 👑 高级节点, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 📉 省流节点, {providers_tags}]}
- {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: 🀄️ 国内 IP, type: select, proxies: [🎯 本地直连, 🚀 节点选择]}
- {name: 🌎 国外域名, type: select, proxies: [🚀 节点选择, 🎯 本地直连]}
- {name: 📲 电报消息, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
- {name: 🔒 私有网络, type: select, proxies: [🎯 全球直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 全球直连]}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT], hidden: true}
- {name: 🔒 私有网络, type: select, proxies: [🎯 本地直连], hidden: true}
- {name: 🐟 漏网之鱼, type: select, proxies: [🚀 节点选择, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇯🇵 日本节点, 🇸🇬 新加坡节点, 🇺🇸 美国节点, 👑 高级节点, 📉 省流节点, {providers_tags}, 🎯 本地直连]}
- {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: 100, include-all: true, filter: "(0\\.[1-5]|低倍率|省流|大流量)"}
@@ -32,7 +32,7 @@ rule-providers:
behavior: domain
format: 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
trackerslist:
@@ -40,7 +40,7 @@ rule-providers:
behavior: domain
format: 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
microsoft-cn:
@@ -48,7 +48,7 @@ rule-providers:
behavior: domain
format: 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
apple-cn:
@@ -56,7 +56,7 @@ rule-providers:
behavior: domain
format: 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
google-cn:
@@ -64,7 +64,7 @@ rule-providers:
behavior: domain
format: 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
games-cn:
@@ -72,7 +72,7 @@ rule-providers:
behavior: domain
format: 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
ai:
@@ -80,7 +80,7 @@ rule-providers:
behavior: domain
format: 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
networktest:
@@ -88,7 +88,7 @@ rule-providers:
behavior: domain
format: 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
proxy:
@@ -96,7 +96,7 @@ rule-providers:
behavior: domain
format: 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
cn:
@@ -104,7 +104,7 @@ rule-providers:
behavior: domain
format: 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
privateip:
@@ -112,7 +112,7 @@ rule-providers:
behavior: ipcidr
format: 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
cnip:
@@ -120,7 +120,7 @@ rule-providers:
behavior: ipcidr
format: 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
telegramip:
@@ -128,7 +128,7 @@ rule-providers:
behavior: ipcidr
format: 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
rules:
@@ -140,9 +140,9 @@ rules:
- RULE-SET,games-cn,🎮 游戏服务
- RULE-SET,ai,🤖 AI 平台
- RULE-SET,networktest,📈 网络测试
- RULE-SET,proxy,🧱 代理域名
- RULE-SET,cn,🛡️ 直连域名
- RULE-SET,proxy,🌎 国外域名
- RULE-SET,cn,🇨🇳 国内域名
- RULE-SET,privateip,🔒 私有网络,no-resolve
- RULE-SET,cnip,🀄️ 直连 IP
- RULE-SET,cnip,🀄️ 国内 IP
- RULE-SET,telegramip,📲 电报消息,no-resolve
- MATCH,🐟 漏网之鱼
- MATCH,🐟 漏网之鱼

View File

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

View File

@@ -169,13 +169,6 @@ rule-providers:
behavior: domain
proxy: DIRECT
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:
type: http
format: mrs
@@ -247,7 +240,6 @@ rules:
- RULE-SET,proxy,🌐 国际流量
- RULE-SET,cn,🀄️ 国内流量
- RULE-SET,gamesip,🎮 外服游戏
- RULE-SET,mediaip,🌍 国际媒体
- RULE-SET,cnip,🀄️ 国内流量

View File

@@ -1,31 +1,31 @@
#ShellCrash-ruleset极简规则
proxy-groups:
- {name: 🚀 节点选择, type: select, proxies: [{providers_tags}], include-all: true}
- {name: 🎯 全球直连, type: select, proxies: [DIRECT, 🚀 节点选择]}
- {name: 🎯 本地直连, type: select, proxies: [DIRECT, 🚀 节点选择]}
rule-providers:
cn:
type: http
behavior: domain
format: 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
privateip:
type: http
behavior: ipcidr
format: 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
cnip:
type: http
behavior: ipcidr
format: 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
rules:
- RULE-SET,privateip,🎯 全球直连,no-resolve
- RULE-SET,cn,🎯 全球直连
- RULE-SET,cnip,🎯 全球直连
- RULE-SET,privateip,🎯 本地直连,no-resolve
- RULE-SET,cn,🎯 本地直连
- RULE-SET,cnip,🎯 本地直连
- MATCH,🚀 节点选择

View File

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

View File

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

View File

@@ -2,7 +2,7 @@
{
"outbounds": [
{ "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": "direct" },
@@ -20,10 +20,10 @@
"route": {
"rules": [
{ "rule_set": [ "private" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "tld-proxy" ], "outbound": "🧱 代理域名" },
{ "rule_set": [ "proxy" ], "outbound": "🧱 代理域名" },
{ "rule_set": [ "tld-proxy" ], "outbound": "🌎 国外域名" },
{ "rule_set": [ "proxy" ], "outbound": "🌎 国外域名" },
{ "rule_set": [ "cn" ], "outbound": "🎯 本地直连" },
{ "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" },
{ "ip_is_private": true, "outbound": "🎯 本地直连" },
{ "rule_set": [ "telegramip" ], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4", "match_only": true},
@@ -63,11 +63,11 @@
"download_detour": "DIRECT"
},
{
"tag": "privateip",
"tag": "telegramip",
"type": "remote",
"format": "binary",
"path": "./ruleset/privateip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/privateip.srs",
"path": "./ruleset/telegramip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/telegramip.srs",
"download_detour": "DIRECT"
},
{
@@ -77,14 +77,6 @@
"path": "./ruleset/cnip.srs",
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cnip.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": "🐟 漏网之鱼"

View File

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

View File

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

View File

@@ -11,7 +11,7 @@
{ "tag": "🎬 奈飞视频", "type": "selector", "outbounds": ["🚀 节点选择", "🎬 奈飞节点", "🎯 本地直连", "♻️ 自动选择", "🛠️ 手动切换", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇪🇺 欧洲节点", "🇰🇷 韩国节点", "🇸🇬 狮城节点", "👑 高级节点", "📉 省流节点", {providers_tags}] },
{ "tag": "🎬 奈飞节点", "type": "urltest", "use_all_providers": true, "include": "(?i)(NF|奈飞|解锁|Netflix|NETFLIX|Media)" },
{ "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}] },
@@ -77,7 +77,6 @@
{ "rule_set": ["telegramip"], "outbound": "📲 电报消息" },
{ "action": "resolve", "server": "dns_proxy", "strategy": "prefer_ipv4" },
{ "rule_set": ["gamesip"], "outbound": "🎮 外服游戏" },
{ "rule_set": ["mediaip"], "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",
"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",
"type": "remote",

View File

@@ -6,7 +6,7 @@
],
"route": {
"rules": [
{ "rule_set": [ "privateip" ], "outbound": "🎯 本地直连" },
{ "ip_is_private": true, "outbound": "🎯 本地直连" },
{ "rule_set": [ "cn" ], "outbound": "🎯 本地直连" },
{ "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",
"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",
"type": "remote",

View File

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

View File

@@ -1,7 +1,6 @@
# ===== 启动完成 =====
START_SERVICE_OK="服务已启动!"
START_WEB_HINT="请前往"
START_WEB_HINT2="管理内置规则"
START_WEB_HINT="管理面板:"
START_PAC_HINT="其他设备可使用 PAC 配置:"
START_PROXY_HINT="或使用 HTTP / SOCKS5 方式连接:"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,6 @@
# ===== Startup =====
START_SERVICE_OK="Service started successfully!"
START_WEB_HINT="Please use"
START_WEB_HINT2="manage built-in rules"
START_WEB_HINT="Dashboard:"
START_PAC_HINT="Other devices can connect using PAC configuration:"
START_PROXY_HINT="Or connect using HTTP / SOCKS5:"

View File

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

View File

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

View File

@@ -2,9 +2,9 @@
DNS_CURRENT_MODE="Current DNS running mode:"
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_ROUTE_DESC="CN domains use real-ip, others use dns2proxy routing"
DNS_MODE_REDIR_DESC="Insecure. Must be used with a third-party DNS service."
DNS_MODE_MIX_DESC="CN domains use DIRECT-DNS, others use fake-ip"
DNS_MODE_ROUTE_DESC="CN domains use DIRECT-DNS, others use PROXY-DNS"
DNS_MODE_REDIR_DESC="All domains use DIRECT-DNS"
DNS_MENU_PROTECT="DNS Leak Protect"
DNS_MENU_HOSTS="Hosts Optimization"

View File

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

View File

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

View File

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

View File

@@ -16,7 +16,7 @@ routing_mark=$((fwmark + 2))
[ -z "$dns_nameserver" ] && {
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_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
#$1日志内容$2显示颜色$3是否推送
#$1日志内容$2显示颜色$3是否推送$4是否覆盖上一条
logger() {
TMPDIR=/tmp/ShellCrash
[ -n "$2" -a "$2" != 0 ] && printf "\033[%sm%s\033[0m\n" "$2" "$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
[ "$(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 "$push_TG" ] && {
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="/var/spool/cron/crontabs"
[ ! -w "$crondir" ] && crondir="/var/spool/cron"
tmpcron="$TMPDIR"/cron_tmp
[ -z "$USER" ] && USER=$(whoami 2>/dev/null)
tmpcron=/tmp/cron_tmp
touch "$tmpcron"
croncmd() { #定时任务工具
if [ -n "$(crontab -h 2>&1 | grep '\-l')" ]; then
cronadd() { #定时任务工具
if crontab -h 2>&1 | grep -q '\-l'; then
crontab "$1"
elif [ -w "$crondir" ] && [ -n "$USER" ];then
[ "$1" = "-l" ] && cat "$crondir"/"$USER" 2>/dev/null
[ -f "$1" ] && cat "$1" >"$crondir"/"$USER"
killall -HUP crond 2>/dev/null
elif [ -f "$crondir/$USER" ];then
cat "$1" >"$crondir"/"$USER" && cru a REFRESH "0 0 1 1 * /bin/true" 2>/dev/null
else
echo "找不到可用的crond或者crontab应用No available crond or crontab application can be found!"
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() { #定时任务设置
# 参数1代表要移除的关键字,参数2代表要添加的任务语句
croncmd -l >"$tmpcron"
sed -i "/$1/d" "$tmpcron"
sed -i '/^$/d' "$tmpcron"
echo "$2" >>"$tmpcron"
croncmd "$tmpcron"
rm -f "$tmpcron"
cronload | grep -v '^$' | grep -vF "$1" >"$tmpcron"
[ -n "$2" ] && echo "$2" >>"$tmpcron"
cronadd "$tmpcron"
#华硕/Padavan固件存档在本地,其他则删除
if [ -d /jffs ] || [ -d /etc/storage/ShellCrash ];then
mv -f "$tmpcron" "$CRASHDIR"/task/cron
else
rm -f "$tmpcron"
fi
}

View File

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

View File

@@ -2,7 +2,7 @@
webget(){
if pidof CrashCore >/dev/null; then
setproxy #设置临时代理
setproxy #设置临时代理,【$1】代表下载目录【$2】代表在线地址
url=$(printf '%s\n' "$2" |
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/#')
@@ -10,31 +10,59 @@ webget(){
url=$(printf '%s\n' "$2" |
sed 's#https://raw.githubusercontent.com/juewuy/ShellCrash/#https://testingcf.jsdelivr.net/gh/juewuy/ShellCrash@#')
fi
# ===============================================
#参数【$1】代表下载目录【$2】代表在线地址
#参数【$3】代表输出显示【$4】不启用重定向
#参数【$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
[ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress'
[ "$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 off $agent $progress $redirect $certificate --timeout=5 -O "$1" "$2"
return $?
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'
[ "$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
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")
else
result=$(curl $agent -w '%{http_code}' --connect-timeout 3 $progress $redirect $certificate -o "$1" "$url")
[ -n "$auth_b64" ] && auth_arg="--proxy-header Proxy-Authorization:Basic $auth_b64"
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 #成功则退出否则重试
export https_proxy=""
export http_proxy=""
result=$(curl $agent -w '%{http_code}' --connect-timeout 5 $progress $redirect $certificate -o "$1" "$2")
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")
fi
[ "$result" = "200" ]
return $?
elif ckcmd wget;then
@@ -46,4 +74,4 @@ webget(){
echo "No Curl or Wget"
return 1
fi
}
}

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -6,98 +6,102 @@ __IS_PROVIDERS_SINGBOX=1
. "$CRASHDIR"/libs/web_get_bin.sh
#生成singbox的providers配置文件
gen_providers(){
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}')"
else
provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
fi
echo "-----------------------------------------------"
if [ -s "$provider_temp_file" ];then
ln -sf "$provider_temp_file" "$TMPDIR"/provider_temp_file
else
echo -e "\033[33m正在获取在线模版\033[0m"
get_bin "$TMPDIR"/provider_temp_file "rules/${CORE_TYPE}_providers/$provider_temp_file"
[ -z "$(grep -o 'route' "$TMPDIR"/provider_temp_file)" ] && {
echo -e "\033[31m下载失败请尝试更换安装源\033[0m"
. "$CRASHDIR"/menus/9_upgrade.sh && setserver
setproviders
}
fi
#生成outbound_providers模块
mkdir -p "$TMPDIR"/providers
#预创建文件并写入对应文件头
cat > "$TMPDIR"/providers/providers.json <<EOF
# 生成singbox的providers配置文件
gen_providers() {
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}')"
else
provider_temp_file=$(grep "provider_temp_${CORE_TYPE}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
fi
if [ -s "$provider_temp_file" ]; then
ln -sf "$provider_temp_file" "$TMPDIR"/provider_temp_file
else
msg_alert "\033[33m正在获取在线模版......\033[0m"
get_bin "$TMPDIR"/provider_temp_file "rules/${CORE_TYPE}_providers/$provider_temp_file"
[ -z "$(grep -o 'route' "$TMPDIR"/provider_temp_file)" ] && {
msg_alert "\033[31m下载失败请尝试更换安装源\033[0m"
. "$CRASHDIR"/menus/9_upgrade.sh && setserver
setproviders
}
fi
# 生成outbound_providers模块
mkdir -p "$TMPDIR"/providers
# 预创建文件并写入对应文件头
cat >"$TMPDIR"/providers/providers.json <<EOF
{
"providers": [
EOF
cat > "$TMPDIR"/providers/outbounds_add.json <<EOF
cat >"$TMPDIR"/providers/outbounds_add.json <<EOF
{
"outbounds": [
EOF
#基于单订阅生成providers模块
if [ -n "$1" ];then
gen_providers_txt $@
providers_tags=\"$1\"
else
#基于全部订阅/本地文件生成
[ -s "$CRASHDIR"/configs/providers.cfg ] && {
providers_tags=''
while read line;do
gen_providers_txt $line
providers_tags=$(echo "$providers_tags, \"$tag\"" | sed 's/^, //')
done < "$CRASHDIR"/configs/providers.cfg
}
#基于全部节点分享链接生成
[ -s "$CRASHDIR"/configs/providers_uri.cfg ] && {
mkdir -p "$CRASHDIR"/providers
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"
providers_tags=$(echo "$providers_tags, \"Uri_group\"" | sed 's/^, //')
}
fi
#修复文件格式
sed -i '$s/},/}]}/' "$TMPDIR"/providers/outbounds_add.json
sed -i '$s/},/}]}/' "$TMPDIR"/providers/providers.json
#使用模版生成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
rm -rf "$TMPDIR"/provider_temp_file
#调用内核测试
. "$CRASHDIR"/starts/check_core.sh && check_core && "$TMPDIR"/CrashCore merge "$TMPDIR"/config.json -C "$TMPDIR"/providers
if [ "$?" = 0 ];then
echo -e "\033[32m配置文件生成成功如果启动超时建议更新里手动安装Singbox-srs数据库常用包\033[0m"
mkdir -p "$CRASHDIR"/jsons
mv -f "$TMPDIR"/config.json "$CRASHDIR"/jsons/config.json
rm -rf "$TMPDIR"/providers
read -p "是否立即启动/重启服务?(1/0) > " res
[ "$res" = 1 ] && {
start_core && . "$CRASHDIR"/libs/set_cron.sh && cronset '更新订阅'
exit
}
else
echo -e "\033[31m生成配置文件出错请仔细检查输入\033[0m"
rm -rf "$TMPDIR"/CrashCore
#rm -rf "$TMPDIR"/providers
fi
# 基于单订阅生成providers模块
if [ -n "$1" ]; then
gen_providers_txt "$@"
providers_tags=\"$1\"
else
# 基于全部订阅/本地文件生成
[ -s "$CRASHDIR"/configs/providers.cfg ] && {
providers_tags=''
while read -r line; do
gen_providers_txt $line
providers_tags=$(echo "$providers_tags, \"$tag\"" | sed 's/^, //')
done <"$CRASHDIR"/configs/providers.cfg
}
# 基于全部节点分享链接生成
[ -s "$CRASHDIR"/configs/providers_uri.cfg ] && {
mkdir -p "$CRASHDIR"/providers
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"
providers_tags=$(echo "$providers_tags, \"Uri_group\"" | sed 's/^, //')
}
fi
# 修复文件格式
sed -i '$s/},/}]}/' "$TMPDIR"/providers/outbounds_add.json
sed -i '$s/},/}]}/' "$TMPDIR"/providers/providers.json
# 使用模版生成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
rm -rf "$TMPDIR"/provider_temp_file
# 调用内核测试
. "$CRASHDIR"/starts/check_core.sh && check_core && "$TMPDIR"/CrashCore merge "$TMPDIR"/config.json -C "$TMPDIR"/providers
if [ "$?" = 0 ]; then
msg_alert "\033[32m配置文件生成成功如果启动超时建议更新里手动安装Singbox-srs数据库常用包\033[0m"
mkdir -p "$CRASHDIR"/jsons
mv -f "$TMPDIR"/config.json "$CRASHDIR"/jsons/config.json
rm -rf "$TMPDIR"/providerss
comp_box "是否立即启动/重启服务?"
btm_box "1) 是" \
"0) 否"
read -r -p "$COMMON_INPUT> " res
[ "$res" = 1 ] && {
start_core && . "$CRASHDIR"/libs/set_cron.sh && cronset '更新订阅'
exit
}
else
rm -rf "$TMPDIR"/CrashCore
msg_alert "\033[31m生成配置文件出错请仔细检查输入\033[0m"
# rm -rf "$TMPDIR"/providers
fi
}
gen_providers_txt(){
tag=$1
interval=${3:-3}
interval2=${4:-12}
ua=${5:-clash.meta}
exclude=${6#\#}
include=${7#\#}
if [ -n "$(echo $2|grep -E '^./')" ];then
cat >> "$TMPDIR"/providers/providers.json <<EOF
gen_providers_txt() {
tag=$1
interval=${3:-3}
interval2=${4:-12}
ua=${5:-clash.meta}
exclude=${6#\#}
include=${7#\#}
[ -n "$exclude" ] && exclude_ele="\"exclude\": \"$exclude\","
[ -n "$include" ] && include_ele="\"include\": \"$include\","
if [ -n "$(echo "$2" | grep -E '^./')" ]; then
cat >>"$TMPDIR"/providers/providers.json <<EOF
{
"tag": "$tag",
"type": "local",
"path": "$2",
EOF
else
cat >> "$TMPDIR"/providers/providers.json <<EOF
else
cat >>"$TMPDIR"/providers/providers.json <<EOF
{
"tag": "$tag",
"type": "remote",
@@ -105,13 +109,13 @@ EOF
"path": "./providers/$tag.yaml",
"user_agent": "$ua",
"update_interval": "${interval2}h",
"exclude": "$exclude",
"include": "$include",
$exclude_ele
$include_ele
EOF
fi
#通用部分生成
[ "$skip_cert" != "OFF" ] && override_tls='true' || override_tls='false'
cat >> "$TMPDIR"/providers/providers.json <<EOF
fi
# 通用部分生成
[ "$skip_cert" != "OFF" ] && override_tls='true' || override_tls='false'
cat >>"$TMPDIR"/providers/providers.json <<EOF
"health_check": {
"enabled": true,
"url": "https://www.gstatic.com/generate_204",
@@ -124,6 +128,6 @@ 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,97 +1,115 @@
#!/bin/sh
# Copyright (C) Juewuy
#. /tmp/SC_tmp/libs/check_dir_avail.sh
[ -f /tmp/SC_tmp/libs/check_dir_avail.sh ] && . /tmp/SC_tmp/libs/check_dir_avail.sh
cecho() {
printf '%b\n' "$*"
}
set_usb_dir() {
while true; do
cecho "请选择安装目录"
du -hL /mnt | awk '{print " "NR" "$2" "$1}'
read -p "请输入相应数字 > " num
comp_box "请选择安装目录"
du -hL /mnt |
awk '{print NR") "$2 " " $1}' |
while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入相应数字> " num
dir=$(du -hL /mnt | awk '{print $2}' | sed -n "$num"p)
if [ -z "$dir" ]; then
cecho "\033[31m输入错误请重新设置\033[0m"
msg_alert "\033[31m输入错误请重新设置\033[0m"
continue
fi
break 1
done
}
set_xiaomi_dir() {
cecho "\033[33m检测到当前设备为小米官方系统请选择安装位置\033[0m"
[ -d /data ] && cecho " 1 安装到 /data 目录,剩余空间:$(dir_avail /data -h)(支持软固化功能)"
[ -d /userdisk ] && cecho " 2 安装到 /userdisk 目录,剩余空间:$(dir_avail /userdisk -h)(支持软固化功能)"
[ -d /data/other_vol ] && cecho " 3 安装到 /data/other_vol 目录,剩余空间:$(dir_avail /data/other_vol -h)(支持软固化功能)"
cecho " 4 安装到自定义目录(不推荐,不明勿用!)"
cecho " 0 退出安装"
echo "-----------------------------------------------"
read -p "请输入相应数字 > " num
case "$num" in
1)
dir=/data
;;
2)
dir=/userdisk
;;
3)
dir=/data/other_vol
;;
4)
set_cust_dir
;;
*)
exit 1
;;
esac
comp_box "\033[33m检测到当前设备为小米官方系统请选择安装位置\033[0m"
[ -d /data ] && content_line "1) /data目录剩余空间:$(dir_avail /data -h) 支持软固化功能"
[ -d /userdisk ] && content_line "2) /userdisk目录剩余空间:$(dir_avail /userdisk -h) 支持软固化功能"
[ -d /data/other_vol ] && content_line "3) /data/other_vol目录剩余空间:$(dir_avail /data/other_vol -h) 支持软固化功能"
content_line "4) 自定义目录不推荐,不明勿用!"
content_line ""
content_line "0) 退出安装"
separator_line "="
read -r -p "请输入相应数字> " num
case "$num" in
1)
dir=/data
;;
2)
dir=/userdisk
;;
3)
dir=/data/other_vol
;;
4)
set_cust_dir
;;
*)
line_break
exit 1
;;
esac
}
set_asus_usb() {
while true; do
echo -e "请选择U盘目录"
du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print " "NR" "$2" "$1}'
read -p "请输入相应数字 > " num
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
echo -e "\033[31m未找到下载大师自启文件$dir/asusware.arm/etc/init.d/S50downloadmaster请检查设置\033[0m"
sleep 1
else
break
fi
done
while true; do
comp_box "请选择U盘目录"
du -hL /tmp/mnt |
awk -F/ 'NF<=4 {print NR") "$2 " " $1}' |
while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入相应数字> " num
dir=$(du -hL /tmp/mnt | awk -F/ 'NF<=4' | awk '{print $2}' | sed -n "$num"p)
if [ ! -f "$dir/asusware.arm/etc/init.d/S50downloadmaster" ]; then
msg_alert "\033[31m未找到下载大师自启文件$dir/asusware.arm/etc/init.d/S50downloadmaster请检查设置\033[0m"
else
break
fi
done
}
set_asus_dir() {
cecho "\033[33m检测到当前设备为华硕固件请选择安装方式\033[0m"
cecho " 1 基于U盘+下载大师安装(支持所有固件限ARM设备须插入U盘或移动硬盘)"
cecho " 2 基于自启脚本安装(仅支持部分梅林固件)"
cecho " 0 退出安装"
echo "-----------------------------------------------"
read -p "请输入相应数字 > " num
case "$num" in
1)
echo -e "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!"
sleep 2
set_asus_usb
;;
2)
cecho "如开机无法正常自启请重新使用U盘+下载大师安装!"
sleep 2
dir=/jffs
;;
*)
exit 1
;;
esac
separator_line "="
btm_box "\033[33m检测到当前设备为华硕固件请选择安装方式\033[0m" \
"1) 基于U盘+下载大师安装支持所有固件限ARM设备须插入U盘或移动硬盘" \
"2) 基于自启脚本安装(仅持部分梅林固件)" \
"" \
"0) 退出安装"
read -r -p "请输入相应数字> " num
case "$num" in
1)
msg_alert -t 2 "请先在路由器网页后台安装下载大师并启用,之后选择外置存储所在目录!"
set_asus_usb
;;
2)
msg_alert -t 2 "如开机无法正常自启请重新使用U盘+下载大师安装!"
dir=/jffs
;;
*)
line_break
exit 1
;;
esac
}
set_cust_dir() {
while true; do
echo "-----------------------------------------------"
echo '可用路径 剩余空间:'
df -h | awk '{print $6,$4}' | sed 1d
echo '路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!!!'
read -p "请输入自定义路径 > " dir
comp_box "路径是必须带 / 的格式,注意写入虚拟内存(/tmp,/opt,/sys...)的文件会在重启后消失!" \
"" \
"可用路径 剩余空间:"
df -h |
awk '{print $6, $4}' |
sed '1d' |
while IFS= read -r line; do
content_line "$line"
done
separator_line "="
read -r -p "请输入自定义路径> " dir
if [ "$(dir_avail "$dir")" = 0 ] || [ -n "$(echo "$dir" | grep -Eq '^/(tmp|opt|sys)(/|$)')" ]; then
cecho "\033[31m路径错误请重新设置\033[0m"
msg_alert "\033[31m路径错误请重新设置\033[0m"
continue
fi
break 1
@@ -100,54 +118,66 @@ set_cust_dir() {
set_crashdir() {
while true; do
echo "-----------------------------------------------"
cecho "\033[33m注意安装ShellCrash至少需要预留约1MB的磁盘空间\033[0m"
top_box "\033[33m注意安装ShellCrash至少需要预留约1MB的磁盘空间\033[0m"
case "$systype" in
Padavan) dir=/etc/storage ;;
mi_snapshot) set_xiaomi_dir ;;
asusrouter) set_asus_dir ;;
ng_snapshot) dir=/tmp/mnt ;;
*)
cecho " 1 在\033[32m/etc目录\033[0m下安装(适合root用户)"
cecho " 2 在\033[32m/usr/share目录\033[0m下安装(适合Linux系统)"
cecho " 3 在\033[32m当前用户目录\033[0m下安装(适合非root用户)"
cecho " 4 在\033[32m外置存储\033[0m中安装"
cecho " 5 手动设置安装目录"
cecho " 0 退出安装"
echo "----------------------------------------------"
read -p "请输入相应数字 > " num
# 设置目录
case "$num" in
1)
dir=/etc
;;
2)
dir=/usr/share
;;
3)
dir=~/.local/share
mkdir -p ~/.config/systemd/user
;;
4)
set_usb_dir
;;
5)
set_cust_dir
;;
*)
echo "安装已取消"
exit 1
;;
esac
;;
esac
Padavan)
dir=/etc/storage
;;
mi_snapshot)
set_xiaomi_dir
;;
asusrouter)
set_asus_dir
;;
ng_snapshot)
dir=/tmp/mnt
;;
*)
separator_line "="
btm_box "1) 在\033[32m/etc目录\033[0m下安装适合root用户" \
"2) 在\033[32m/usr/share目录\033[0m下安装适合Linux系统" \
"3) 在\033[32m当前用户目录\033[0m下安装适合非root用户" \
"4) 在\033[32m外置存储\033[0m中安装" \
"5) 手动设置安装目录" \
"" \
"0) 退出安装"
read -r -p "请输入相应数字> " num
# 设置目录
case "$num" in
1)
dir=/etc
;;
2)
dir=/usr/share
;;
3)
dir=~/.local/share
mkdir -p ~/.config/systemd/user
;;
4)
set_usb_dir
;;
5)
set_cust_dir
;;
*)
msg_alert "安装已取消"
line_break
exit 1
;;
esac
;;
esac
if [ ! -w "$dir" ]; then
cecho "\033[31m没有$dir目录写入权限!请重新设置!\033[0m"
sleep 1
msg_alert "\033[31m没有$dir目录写入权限!请重新设置!\033[0m"
else
cecho "目标目录\033[32m$dir\033[0m空间剩余$(dir_avail "$dir" -h)"
read -p "确认安装?(1/0) > " res
comp_box "目标目录\033[32m$dir\033[0m空间剩余$(dir_avail "$dir" -h)" \
"" \
"是否确认安装?"
btm_box "1) 是" \
"0) 否"
read -r -p "请输入相应数字> " res
if [ "$res" = "1" ]; then
CRASHDIR="$dir"/ShellCrash
break

View File

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

View File

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

View File

@@ -113,11 +113,7 @@ content_line() {
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
# for printing accompanying instructions
sub_content_line() {
@@ -150,5 +146,3 @@ separator_line() {
line_break() {
printf "\n\n"
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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