mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-01 15:43:56 +08:00
update 2026-09-20 23:17:18
This commit is contained in:
1 parent
735d247cbe
commit
d657bc36f5
23 files changed
+2655
-667
No files matched your search
@@ -120,8 +120,17 @@ 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("passwall2") then filter = true end
|
||||
if line:find("ubus") then filter = true end
|
||||
@@ -140,7 +149,10 @@ function copy_instance(var)
|
||||
tinsert(conf_lines, line)
|
||||
end
|
||||
end
|
||||
else
|
||||
sys.call("logger -t passwall2 'ERROR: dnsmasq config " .. conf_file .. " not found after 5s wait! DNS hijacking will fail.'")
|
||||
end
|
||||
|
||||
tinsert(conf_lines, "port=" .. LISTEN_PORT)
|
||||
--dhcp.leases to hostsMore actions
|
||||
local hosts = api.CACHE_PATH .. "/dhcp-hosts"
|
||||
|
||||
@@ -6,7 +6,7 @@ CONFIG=passwall2
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user