luci-app-passwall2: sync upstream

last commit: d38484519a
This commit is contained in:
gitea-action 2024-12-22 17:00:20 +08:00
parent d7c9a16f1e
commit a6aa2ff602
3 changed files with 8 additions and 8 deletions

View File

@ -220,7 +220,7 @@ function is_install(package)
local file_path = "/usr/lib/opkg/info"
local file_ext = ".control"
local has = sys.call("[ -d " .. file_path .. " ]")
if has == 0 then
if has ~= 0 then
file_path = "/lib/apk/packages"
file_ext = ".list"
end

View File

@ -797,6 +797,8 @@ run_global() {
-DEFAULT_DNS ${AUTO_DNS} -LOCAL_DNS ${LOCAL_DNS:-${AUTO_DNS}} -TUN_DNS ${TUN_DNS} \
-NFTFLAG ${nftflag:-0} \
-NO_LOGIC_LOG ${NO_LOGIC_LOG:-0}
uci -q add_list dhcp.@dnsmasq[0].addnmount=${GLOBAL_DNSMASQ_CONF_PATH}
uci -q commit dhcp
lua $APP_PATH/helper_dnsmasq.lua logic_restart -LOG 1
else
#Run a copy dnsmasq instance, DNS hijack for that need proxy devices.
@ -1234,7 +1236,7 @@ start() {
USE_TABLES="nftables"
nftflag=1
config_t_set global_forwarding use_nft 1
uci commit ${CONFIG}
uci -q commit ${CONFIG}
fi
fi
else
@ -1302,6 +1304,8 @@ stop() {
uci -q commit ${CONFIG}
}
if [ -z "$(get_cache_var "ACL_default_dns_port")" ] || [ -n "${bak_dnsmasq_dns_redirect}" ]; then
uci -q del_list dhcp.@dnsmasq[0].addnmount="${GLOBAL_DNSMASQ_CONF_PATH}"
uci -q commit dhcp
lua $APP_PATH/helper_dnsmasq.lua restart -LOG 0
fi
bak_bridge_nf_ipt=$(get_cache_var "bak_bridge_nf_ipt")

View File

@ -314,12 +314,8 @@ function add_rule(var)
f_out:close()
end
if api.is_install("procd\\-ujail") then
fs.copyr(CACHE_DNS_PATH, TMP_DNSMASQ_PATH)
else
api.remove(TMP_DNSMASQ_PATH)
fs.symlink(CACHE_DNS_PATH, TMP_DNSMASQ_PATH)
end
if DNSMASQ_CONF_FILE ~= "nil" then
local conf_lines = {}