From a7a2bdf603dda4904b07bcf84c480051e654c3f4 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 8 Mar 2020 20:37:58 +0800 Subject: [PATCH] luci-app-passwall: sync with upstream source --- package/lienol/luci-app-passwall/Makefile | 2 +- .../luasrc/view/passwall/rule/rule_version.htm | 2 +- .../root/usr/share/passwall/rule_update.lua | 6 ++---- .../root/usr/share/passwall/subscribe.lua | 9 ++++++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile index 307e0b3976..a63daba983 100644 --- a/package/lienol/luci-app-passwall/Makefile +++ b/package/lienol/luci-app-passwall/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=3.6 -PKG_RELEASE:=18 +PKG_RELEASE:=19 PKG_DATE:=20200308 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm index 2447822083..b93e65d36f 100644 --- a/package/lienol/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm +++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/rule/rule_version.htm @@ -75,7 +75,7 @@ local chnlist_update = api.uci_get_type("global_rules", "chnlist_update", "1") =
【 <%=chnlist_version%> 】 - /> + />
diff --git a/package/lienol/luci-app-passwall/root/usr/share/passwall/rule_update.lua b/package/lienol/luci-app-passwall/root/usr/share/passwall/rule_update.lua index b10bad162c..434c6f21f8 100644 --- a/package/lienol/luci-app-passwall/root/usr/share/passwall/rule_update.lua +++ b/package/lienol/luci-app-passwall/root/usr/share/passwall/rule_update.lua @@ -79,7 +79,6 @@ if version then if download_md5 == new_md5 then luci.sys.exec("mv -f /tmp/gfwlist_tmp " .. rule_path .. "/gfwlist.conf") ucic:set(name, ucic:get_first(name, 'global_rules'), "gfwlist_version", new_version) - ucic:commit(name) reboot = 1 log("更新gfwlist成功...") end @@ -105,7 +104,6 @@ if version then if download_md5 == new_md5 then luci.sys.exec("mv -f /tmp/chnroute_tmp " .. rule_path .. "/chnroute") ucic:set(name, ucic:get_first(name, 'global_rules'), "chnroute_version", new_version) - ucic:commit(name) reboot = 1 log("更新chnroute成功...") end @@ -131,7 +129,6 @@ if version then if download_md5 == new_md5 then luci.sys.exec("mv -f /tmp/chnlist_tmp " .. rule_path .. "/chnlist") ucic:set(name, ucic:get_first(name, 'global_rules'), "chnlist_version", new_version) - ucic:commit(name) reboot = 1 log("更新chnlist成功...") end @@ -146,7 +143,8 @@ end ucic:set(name, ucic:get_first(name, 'global_rules'), "gfwlist_update", gfwlist_update) ucic:set(name, ucic:get_first(name, 'global_rules'), "chnroute_update", chnroute_update) ucic:set(name, ucic:get_first(name, 'global_rules'), "chnlist_update", chnlist_update) -ucic:commit(name) +ucic:save(name) +luci.sys.call("uci commit " .. name) if reboot == 1 then log("重启服务,应用新的规则。") diff --git a/package/lienol/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/package/lienol/luci-app-passwall/root/usr/share/passwall/subscribe.lua index c934eeb9b2..9d28dc8f5a 100644 --- a/package/lienol/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/package/lienol/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -340,7 +340,8 @@ local function truncate_nodes() return false end end) - ucic:commit(application) + ucic:save(application) + luci.sys.call("uci commit " .. application) if is_stop == 1 then luci.sys.call("/etc/init.d/" .. application .. " restart > /dev/null 2>&1 &") -- 不加&的话日志会出现的更早 @@ -417,7 +418,8 @@ local function update_node() ucic:tset(application, section, vv) end end - ucic:commit(application) + ucic:save(application) + luci.sys.call("uci commit " .. application) if next(CONFIG) then local nodes = {} @@ -429,7 +431,8 @@ local function update_node() for _, config in pairs(CONFIG) do select_node(nodes, config) end - ucic:commit(application) + ucic:save(application) + luci.sys.call("uci commit " .. application) luci.sys.call("/etc/init.d/" .. application .. " restart > /dev/null 2>&1 &") -- 不加&的话日志会出现的更早 end