AdGuardHome: deleted depention dnsforwarder

This commit is contained in:
CN_SZTL 2019-07-04 14:47:45 +08:00
parent 4fdb0c472f
commit abb6110cd6
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
5 changed files with 5 additions and 8 deletions

View File

@ -16,7 +16,7 @@ define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=AdGuardHome
DEPENDS:=+openwrt-dnsforwarder
DEPENDS:=
URL:=https://github.com/AdguardTeam/AdGuardHome/releases
endef

View File

@ -25,7 +25,7 @@ local function is_fullcone()
end
local function is_dns()
return luci.sys.call("pgrep dnscache >/dev/null") == 0
return luci.sys.call("[ `uci get flowoffload.@flow[0].dnscache_enable 2>/dev/null -ne 3` ] && pgrep dnscache >/dev/null || pgrep AdGuardHome >/dev/null") == 0
end
local function is_ad()

View File

@ -71,11 +71,12 @@ o:depends("dns", 1)
o = s:option(Value, "dns_server", translate("Upsteam DNS Server"))
o.default = "114.114.114.114,114.114.115.115,223.5.5.5,223.6.6.6,180.76.76.76,119.29.29.29,119.28.28.28,1.2.4.8,210.2.4.8"
o.description = translate("Muitiple DNS server can saperate with ','")
o:depends("dnscache_enable", 1)
o:depends("dnscache_enable", 2)
o = s:option(Value, "ipv6dns_server", translate("Upsteam IPV6 DNS Server"))
o.default = "2001:4860:4860::8888,2001:4860:4860::8844,2001:2001::1111,2001:2001::1001,2400:da00::6666,240C::6666,240C::6644"
o.description = translate("Muitiple IPV6 DNS server can saperate with ','")
o:depends("dnscache_enable", 2)
o:depends("dnscache_enable", 3)
return m

View File

@ -237,7 +237,6 @@ start_service(){
elif [ $dnscache_enable = "2" ]; then
start_dnsforwarder
elif [ $dnscache_enable = "3" ]; then
start_dnsforwarder
AdGuardHome -c /etc/AdGuardHome/AdGuardHome.yaml -w /etc/AdGuardHome -h ${lan_addr} -p 3000 >/dev/null 2>&1 &
fi
change_dns

View File

@ -24,14 +24,11 @@ if [ $dns_enable -eq 1 ]; then
AdGuardHome -c /etc/AdGuardHome/AdGuardHome.yaml -w /etc/AdGuardHome >/dev/null 2>&1 &
echo "$curtime 重启服务!" >> ${logfile}
fi
if ! pidof dnscache>/dev/null; then
dnscache -f /var/run/dnscache/dnscache.conf -d
fi
else
if ! pidof dnscache>/dev/null; then
if [ $dnscache_enable = "1" ]; then
/usr/sbin/dnscache -c /var/etc/dnscache.conf -d
elif [ $dnscache_enable = "2" ] || [ $dnscache_enable = "3" ]; then
elif [ $dnscache_enable = "2" ]; then
dnscache -f /var/run/dnscache/dnscache.conf -d
fi
echo "$curtime 重启服务!" >> ${logfile}