update 2026-09-20 23:17:18

This commit is contained in:
action committed 2026-09-20 23:17:18 +08:00
1 parent 735d247cbe
commit d657bc36f5
23 files changed
+2655 -667

No files matched your search

@@ -118,8 +118,16 @@ function copy_instance(var)
local TMP_DNSMASQ_PATH = var["-TMP_DNSMASQ_PATH"]
local conf_lines = {}
local DEFAULT_DNSMASQ_CFGID = sys.exec("echo -n $(uci -q show dhcp.@dnsmasq[0] | awk 'NR==1 {split($0, conf, /[.=]/); print conf[2]}')")
if fs.access("/var/etc/dnsmasq.conf." .. DEFAULT_DNSMASQ_CFGID) then
for line in io.lines("/var/etc/dnsmasq.conf." .. DEFAULT_DNSMASQ_CFGID) do
local conf_file = "/var/etc/dnsmasq.conf." .. DEFAULT_DNSMASQ_CFGID
local retry = 5
while not fs.access(conf_file) and retry > 0 do
api.nixio.nanosleep(1, 0)
retry = retry - 1
end
if fs.access(conf_file) then
for line in io.lines(conf_file) do
local filter
if line:find("passwall") then filter = true end
if line:find("ubus") then filter = true end
@@ -139,7 +147,10 @@ function copy_instance(var)
tinsert(conf_lines, line)
end
end
else
sys.call("logger -t passwall 'ERROR: dnsmasq config " .. conf_file .. " not found after 5s wait! DNS hijacking will fail.'")
end
tinsert(conf_lines, "port=" .. LISTEN_PORT)
if TMP_DNSMASQ_PATH then
sys.call("rm -rf " .. TMP_DNSMASQ_PATH .. "/*passwall*")
@@ -6,7 +6,7 @@ CONFIG=passwall
APP_PATH=/usr/share/${CONFIG}
TMP_PATH=/tmp/etc/${CONFIG}
TMP_PATH2=${TMP_PATH}_tmp
LOCK_PATH=/tmp/lock
LOCK_PATH=/var/lock
LOG_FILE=/tmp/log/${CONFIG}.log
TMP_ACL_PATH=${TMP_PATH}/acl
TMP_BIN_PATH=${TMP_PATH}/bin