diff --git a/luci-app-passwall2/root/usr/share/passwall2/app.sh b/luci-app-passwall2/root/usr/share/passwall2/app.sh index 3a67fcae..3d73de5c 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/app.sh +++ b/luci-app-passwall2/root/usr/share/passwall2/app.sh @@ -794,7 +794,7 @@ 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} - /etc/init.d/dnsmasq restart >/dev/null 2>&1 + lua $APP_PATH/helper_dnsmasq.lua logic_restart -LOG 1 else #Run a copy dnsmasq instance, DNS hijack for that need proxy devices. GLOBAL_DNSMASQ_PORT=$(get_new_port 11400) @@ -1256,7 +1256,7 @@ start() { uci -q commit ${CONFIG} uci -q set dhcp.@dnsmasq[0].dns_redirect='0' uci -q commit dhcp - /etc/init.d/dnsmasq restart >/dev/null 2>&1 + lua $APP_PATH/helper_dnsmasq.lua restart -LOG 0 } fi [ "$ENABLED_DEFAULT_ACL" == 1 ] && run_global diff --git a/luci-app-passwall2/root/usr/share/passwall2/helper_dnsmasq.lua b/luci-app-passwall2/root/usr/share/passwall2/helper_dnsmasq.lua index 9e93b68e..3f74227b 100644 --- a/luci-app-passwall2/root/usr/share/passwall2/helper_dnsmasq.lua +++ b/luci-app-passwall2/root/usr/share/passwall2/helper_dnsmasq.lua @@ -102,10 +102,8 @@ function logic_restart(var) tinsert(dns_table, v) end end - if dns_table and #dns_table > 0 then - uci:set_list("dhcp", "@dnsmasq[0]", "server", dns_table) - uci:commit("dhcp") - end + uci:set_list("dhcp", "@dnsmasq[0]", "server", dns_table) + uci:commit("dhcp") end sys.call("/etc/init.d/dnsmasq restart >/dev/null 2>&1") restore_servers()