From b29c5ffcff5477bce2e51dfe660c781662cb429a Mon Sep 17 00:00:00 2001 From: gitea-action Date: Fri, 10 Jan 2025 14:30:17 +0800 Subject: [PATCH] luci-app-passwall: sync upstream last commit: https://github.com/xiaorouji/openwrt-passwall/commit/1021c8b70fbb5a7ad7534f40be3c96c481d9c72b --- .../root/usr/share/passwall/subscribe.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/luci-app-passwall/root/usr/share/passwall/subscribe.lua index 546a41e86..947d5ef9f 100755 --- a/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -1433,7 +1433,7 @@ end local function update_node(manual) if next(nodeResult) == nil then - log("更新失败,没有可用的节点信息") + log("没有可用的节点信息更新。") return end @@ -1670,8 +1670,15 @@ local execute = function() local stdout = f:read("*all") f:close() raw = trim(stdout) - os.remove("/tmp/" .. cfgid) - parse_link(raw, "2", remark) + local old_md5 = value.md5 or "" + local new_md5 = luci.sys.exec(string.format("echo -n $(echo '%s' | md5sum | awk '{print $1}')", raw)) + if old_md5 == new_md5 then + log('订阅:【' .. remark .. '】没有变化,无需更新。') + else + os.remove("/tmp/" .. cfgid) + parse_link(raw, "2", remark) + uci:set(appname, cfgid, "md5", new_md5) + end else fail_list[#fail_list + 1] = value end