From 2674e557e0c3012da03e6788b9fcfef917ad4323 Mon Sep 17 00:00:00 2001 From: gitea-action Date: Sun, 18 May 2025 23:31:00 +0800 Subject: [PATCH] luci-app-passwall: sync upstream last commit: https://github.com/xiaorouji/openwrt-passwall/commit/37933be15e0b391d910d824fb9af3a9eca6e9074 --- .../root/usr/share/passwall/helper_dnsmasq.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua b/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua index 0247edb1c..c22d4ea21 100644 --- a/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua +++ b/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua @@ -672,6 +672,10 @@ function add_rule(var) if LISTEN_PORT then --Copy dnsmasq instance conf_lines = copy_instance({["-LISTEN_PORT"] = LISTEN_PORT, ["-TMP_DNSMASQ_PATH"] = TMP_DNSMASQ_PATH, ["-return"] = "1"}) + --dhcp.leases to hosts + local hosts = "/tmp/etc/" .. appname .. "_tmp/dhcp-hosts" + sys.call("touch " .. hosts) + tinsert(conf_lines, "addn-hosts=" .. hosts) else --Modify the default dnsmasq service end @@ -693,12 +697,6 @@ function add_rule(var) api.set_cache_var("DEFAULT_DNS", DEFAULT_DNS) end end - - --dhcp.leases to hosts - local hosts = "/tmp/etc/" .. appname .. "_tmp/dhcp-hosts" - sys.call("touch " .. hosts) - tinsert(conf_lines, "addn-hosts=" .. hosts) - if #conf_lines > 0 then local conf_out = io.open(DNSMASQ_CONF_FILE, "a") conf_out:write(table.concat(conf_lines, "\n"))