Skip to content

Commit 59392a9

Browse files
committed
customize: 优化模块升级时内置资源更新与本地规则保留逻辑
- 精细化备份名单(PRESERVE_CONFIGS),在保留用户个人配置(module.conf、tproxy.conf、confdir/、outbounds/)以及 direct/proxy/block.json 本地分流规则的同时,确保内置规则不会被旧备份文件覆盖。 - 将内置资源路径(cn.zone、cn_ipv6.zone 以及 singbox/source)追加至 sync_dirs 的覆盖同步列表中,确保升级后 live 运行时目录能成功同步并生效最新版的上游规则。
1 parent 907d87a commit 59392a9

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/module/customize.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ PROXY_WAS_RUNNING=false
2727
# 需要保留的配置文件/目录 (相对于 config/)
2828
readonly PRESERVE_CONFIGS="
2929
module.conf
30-
tproxy/
31-
singbox/
30+
tproxy/tproxy.conf
31+
singbox/confdir/
32+
singbox/outbounds/
33+
singbox/source/direct.json
34+
singbox/source/proxy.json
35+
singbox/source/block.json
3236
"
3337

3438
# 需要设置可执行权限的文件
@@ -255,8 +259,8 @@ sync_to_live() {
255259
return 0
256260
fi
257261

258-
# 同步程序文件与脚本 (整目录覆盖)
259-
local sync_dirs="bin scripts action.sh service.sh module.prop"
262+
# 同步程序文件与脚本,以及需要更新的内置资源 (整目录/文件覆盖)
263+
local sync_dirs="bin scripts action.sh service.sh module.prop config/tproxy/cn.zone config/tproxy/cn_ipv6.zone config/singbox/source"
260264

261265
for item in $sync_dirs; do
262266
local src="$MODPATH/$item"

0 commit comments

Comments
 (0)