add watchdog for DNS cache

This commit is contained in:
coolsnowwolf 2018-10-08 02:10:17 +08:00
parent 8af0ba96b4
commit 3490ccb7a3
7 changed files with 17 additions and 5 deletions

View File

@ -150,7 +150,7 @@ menu "Target Images"
int "Block size (in KiB)"
depends on TARGET_ROOTFS_SQUASHFS
default 64 if LOW_MEMORY_FOOTPRINT
default 1024
default 512
menuconfig TARGET_ROOTFS_UBIFS
bool "ubifs"

View File

@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for Flow Offload
LUCI_DEPENDS:=+kmod-ipt-offload +pdnsd-alt @LINUX_4_14
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=9
PKG_RELEASE:=10
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -134,7 +134,7 @@ stop_pdnsd() {
change_dns() {
uci delete dhcp.@dnsmasq[0].server >/dev/null 2>&1
uci add_list dhcp.@dnsmasq[0].server=127.0.0.1#5333
uci delete dhcp.@dnsmasq[0].resolvfile >/dev/null 2>&1
uci set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto
uci set dhcp.@dnsmasq[0].noresolv=0
uci commit dhcp
}

View File

@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for Turbo ACC (SFE)
LUCI_DEPENDS:=+kmod-fast-classifier +pdnsd-alt @LINUX_4_9
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=12
PKG_RELEASE:=10
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -134,7 +134,7 @@ stop_pdnsd() {
change_dns() {
uci delete dhcp.@dnsmasq[0].server >/dev/null 2>&1
uci add_list dhcp.@dnsmasq[0].server=127.0.0.1#5333
uci delete dhcp.@dnsmasq[0].resolvfile >/dev/null 2>&1
uci set dhcp.@dnsmasq[0].resolvfile=/tmp/resolv.conf.auto
uci set dhcp.@dnsmasq[0].noresolv=0
uci commit dhcp
}

View File

@ -7,6 +7,9 @@ uci -q batch <<-EOF >/dev/null
commit ucitrack
EOF
sed -i '/dnscache-watchdog.sh/d' /etc/crontabs/root
echo '*/1 * * * * /usr/share/dnscache-watchdog.sh' >> /etc/crontabs/root
[ ! -f /usr/sbin/dnscache ] && ln /usr/sbin/pdnsd /usr/sbin/dnscache
/etc/init.d/sfe enable

View File

@ -0,0 +1,9 @@
#!/bin/sh
dns_enable=$(uci get sfe.config.dns 2>/dev/null)
if [ $dns_enable -eq 1 ]; then
if ! pidof dnscache>/dev/null; then
/etc/init.d/sfe restart
fi
fi