parent
107d060562
commit
ab971e5e1e
@ -1561,7 +1561,6 @@ start_dns() {
|
|||||||
echolog " * 未安装SmartDNS,默认使用Dnsmasq进行域名解析!"
|
echolog " * 未安装SmartDNS,默认使用Dnsmasq进行域名解析!"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
rm -rf $TMP_PATH2/smartdns_default*
|
|
||||||
|
|
||||||
[ "$DNS_SHUNT" = "chinadns-ng" ] && [ -n "$(first_type chinadns-ng)" ] && {
|
[ "$DNS_SHUNT" = "chinadns-ng" ] && [ -n "$(first_type chinadns-ng)" ] && {
|
||||||
chinadns_ng_min=2024.04.13
|
chinadns_ng_min=2024.04.13
|
||||||
|
@ -23,10 +23,6 @@ local DEFAULT_PROXY_MODE = var["-DEFAULT_PROXY_MODE"]
|
|||||||
local NO_PROXY_IPV6 = var["-NO_PROXY_IPV6"]
|
local NO_PROXY_IPV6 = var["-NO_PROXY_IPV6"]
|
||||||
local NO_LOGIC_LOG = var["-NO_LOGIC_LOG"]
|
local NO_LOGIC_LOG = var["-NO_LOGIC_LOG"]
|
||||||
local NFTFLAG = var["-NFTFLAG"]
|
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 uci = api.uci
|
||||||
local sys = api.sys
|
local sys = api.sys
|
||||||
@ -37,6 +33,7 @@ local TMP_PATH = "/tmp/etc/" .. appname
|
|||||||
local TMP_ACL_PATH = TMP_PATH .. "/acl"
|
local TMP_ACL_PATH = TMP_PATH .. "/acl"
|
||||||
local RULES_PATH = "/usr/share/" .. appname .. "/rules"
|
local RULES_PATH = "/usr/share/" .. appname .. "/rules"
|
||||||
local FLAG_PATH = TMP_ACL_PATH .. "/" .. FLAG
|
local FLAG_PATH = TMP_ACL_PATH .. "/" .. FLAG
|
||||||
|
local TMP_CONF_FILE = FLAG_PATH .. "/smartdns.conf"
|
||||||
local config_lines = {}
|
local config_lines = {}
|
||||||
local tmp_lines = {}
|
local tmp_lines = {}
|
||||||
local USE_GEOVIEW = uci:get(appname, "@global_rules[0]", "enable_geoview")
|
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)
|
fs.mkdir(FLAG_PATH)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not fs.access(CACHE_PATH) then
|
|
||||||
fs.mkdir(CACHE_PATH)
|
|
||||||
end
|
|
||||||
|
|
||||||
local LOCAL_EXTEND_ARG = ""
|
local LOCAL_EXTEND_ARG = ""
|
||||||
if LOCAL_GROUP == "nil" then
|
if LOCAL_GROUP == "nil" then
|
||||||
LOCAL_GROUP = nil
|
LOCAL_GROUP = nil
|
||||||
@ -603,7 +596,7 @@ if uci:get(appname, TCP_NODE, "protocol") == "_shunt" then
|
|||||||
end
|
end
|
||||||
|
|
||||||
if #config_lines > 0 then
|
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
|
for i = 1, #config_lines do
|
||||||
line = config_lines[i]
|
line = config_lines[i]
|
||||||
if line ~= "" and not line:find("^#--") then
|
if line ~= "" and not line:find("^#--") then
|
||||||
@ -617,6 +610,6 @@ if DEFAULT_DNS_GROUP then
|
|||||||
log(string.format(" - 默认 DNS 分组:%s", DEFAULT_DNS_GROUP))
|
log(string.format(" - 默认 DNS 分组:%s", DEFAULT_DNS_GROUP))
|
||||||
end
|
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 .. "*")))
|
sys.call(string.format('echo "conf-file %s" >> /etc/smartdns/custom.conf', string.gsub(SMARTDNS_CONF, appname, appname .. "*")))
|
||||||
log(" - 请让SmartDNS作为Dnsmasq的上游或重定向!")
|
log(" - 请让SmartDNS作为Dnsmasq的上游或重定向!")
|
||||||
|
@ -1408,7 +1408,6 @@ stop() {
|
|||||||
uci -q commit ${CONFIG}
|
uci -q commit ${CONFIG}
|
||||||
flush_ipset
|
flush_ipset
|
||||||
rm -rf /tmp/etc/passwall_tmp/singbox*
|
rm -rf /tmp/etc/passwall_tmp/singbox*
|
||||||
rm -rf /tmp/etc/passwall_tmp/smartdns*
|
|
||||||
rm -rf /tmp/etc/passwall_tmp/dnsmasq*
|
rm -rf /tmp/etc/passwall_tmp/dnsmasq*
|
||||||
}
|
}
|
||||||
flush_include
|
flush_include
|
||||||
|
@ -1412,7 +1412,6 @@ stop() {
|
|||||||
#flush_table
|
#flush_table
|
||||||
flush_nftset
|
flush_nftset
|
||||||
rm -rf /tmp/etc/passwall_tmp/singbox*
|
rm -rf /tmp/etc/passwall_tmp/singbox*
|
||||||
rm -rf /tmp/etc/passwall_tmp/smartdns*
|
|
||||||
rm -rf /tmp/etc/passwall_tmp/dnsmasq*
|
rm -rf /tmp/etc/passwall_tmp/dnsmasq*
|
||||||
}
|
}
|
||||||
flush_include
|
flush_include
|
||||||
|
Loading…
Reference in New Issue
Block a user