diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index 45e23031b..c0c2ad55c 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -1561,7 +1561,6 @@ start_dns() { echolog " * 未安装SmartDNS,默认使用Dnsmasq进行域名解析!" fi } - rm -rf $TMP_PATH2/smartdns_default* [ "$DNS_SHUNT" = "chinadns-ng" ] && [ -n "$(first_type chinadns-ng)" ] && { chinadns_ng_min=2024.04.13 diff --git a/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua b/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua index ed0fa0bfc..bd06c07c9 100644 --- a/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua +++ b/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua @@ -23,10 +23,6 @@ local DEFAULT_PROXY_MODE = var["-DEFAULT_PROXY_MODE"] local NO_PROXY_IPV6 = var["-NO_PROXY_IPV6"] local NO_LOGIC_LOG = var["-NO_LOGIC_LOG"] local NFTFLAG = var["-NFTFLAG"] -local CACHE_PATH = api.CACHE_PATH -local CACHE_FLAG = "smartdns_" .. FLAG -local CACHE_DNS_PATH = CACHE_PATH .. "/" .. CACHE_FLAG -local CACHE_DNS_FILE = CACHE_DNS_PATH .. ".conf" local uci = api.uci local sys = api.sys @@ -37,6 +33,7 @@ local TMP_PATH = "/tmp/etc/" .. appname local TMP_ACL_PATH = TMP_PATH .. "/acl" local RULES_PATH = "/usr/share/" .. appname .. "/rules" local FLAG_PATH = TMP_ACL_PATH .. "/" .. FLAG +local TMP_CONF_FILE = FLAG_PATH .. "/smartdns.conf" local config_lines = {} local tmp_lines = {} local USE_GEOVIEW = uci:get(appname, "@global_rules[0]", "enable_geoview") @@ -107,10 +104,6 @@ if not fs.access(FLAG_PATH) then fs.mkdir(FLAG_PATH) end -if not fs.access(CACHE_PATH) then - fs.mkdir(CACHE_PATH) -end - local LOCAL_EXTEND_ARG = "" if LOCAL_GROUP == "nil" then LOCAL_GROUP = nil @@ -603,7 +596,7 @@ if uci:get(appname, TCP_NODE, "protocol") == "_shunt" then end if #config_lines > 0 then - local f_out = io.open(CACHE_DNS_FILE, "w") + local f_out = io.open(TMP_CONF_FILE, "w") for i = 1, #config_lines do line = config_lines[i] if line ~= "" and not line:find("^#--") then @@ -617,6 +610,6 @@ if DEFAULT_DNS_GROUP then log(string.format(" - 默认 DNS 分组:%s", DEFAULT_DNS_GROUP)) end -fs.symlink(CACHE_DNS_FILE, SMARTDNS_CONF) +fs.symlink(TMP_CONF_FILE, SMARTDNS_CONF) sys.call(string.format('echo "conf-file %s" >> /etc/smartdns/custom.conf', string.gsub(SMARTDNS_CONF, appname, appname .. "*"))) log(" - 请让SmartDNS作为Dnsmasq的上游或重定向!") diff --git a/luci-app-passwall/root/usr/share/passwall/iptables.sh b/luci-app-passwall/root/usr/share/passwall/iptables.sh index 51843cfe9..d10d526f2 100755 --- a/luci-app-passwall/root/usr/share/passwall/iptables.sh +++ b/luci-app-passwall/root/usr/share/passwall/iptables.sh @@ -1408,7 +1408,6 @@ stop() { uci -q commit ${CONFIG} flush_ipset rm -rf /tmp/etc/passwall_tmp/singbox* - rm -rf /tmp/etc/passwall_tmp/smartdns* rm -rf /tmp/etc/passwall_tmp/dnsmasq* } flush_include diff --git a/luci-app-passwall/root/usr/share/passwall/nftables.sh b/luci-app-passwall/root/usr/share/passwall/nftables.sh index 4f74a5b46..7bdf9631f 100755 --- a/luci-app-passwall/root/usr/share/passwall/nftables.sh +++ b/luci-app-passwall/root/usr/share/passwall/nftables.sh @@ -1412,7 +1412,6 @@ stop() { #flush_table flush_nftset rm -rf /tmp/etc/passwall_tmp/singbox* - rm -rf /tmp/etc/passwall_tmp/smartdns* rm -rf /tmp/etc/passwall_tmp/dnsmasq* } flush_include