mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
add watchdog for DNS cache
This commit is contained in:
parent
8af0ba96b4
commit
3490ccb7a3
@ -150,7 +150,7 @@ menu "Target Images"
|
|||||||
int "Block size (in KiB)"
|
int "Block size (in KiB)"
|
||||||
depends on TARGET_ROOTFS_SQUASHFS
|
depends on TARGET_ROOTFS_SQUASHFS
|
||||||
default 64 if LOW_MEMORY_FOOTPRINT
|
default 64 if LOW_MEMORY_FOOTPRINT
|
||||||
default 1024
|
default 512
|
||||||
|
|
||||||
menuconfig TARGET_ROOTFS_UBIFS
|
menuconfig TARGET_ROOTFS_UBIFS
|
||||||
bool "ubifs"
|
bool "ubifs"
|
||||||
|
@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for Flow Offload
|
|||||||
LUCI_DEPENDS:=+kmod-ipt-offload +pdnsd-alt @LINUX_4_14
|
LUCI_DEPENDS:=+kmod-ipt-offload +pdnsd-alt @LINUX_4_14
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
PKG_VERSION:=1.0
|
PKG_VERSION:=1.0
|
||||||
PKG_RELEASE:=9
|
PKG_RELEASE:=10
|
||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ stop_pdnsd() {
|
|||||||
change_dns() {
|
change_dns() {
|
||||||
uci delete dhcp.@dnsmasq[0].server >/dev/null 2>&1
|
uci delete dhcp.@dnsmasq[0].server >/dev/null 2>&1
|
||||||
uci add_list dhcp.@dnsmasq[0].server=127.0.0.1#5333
|
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 set dhcp.@dnsmasq[0].noresolv=0
|
||||||
uci commit dhcp
|
uci commit dhcp
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for Turbo ACC (SFE)
|
|||||||
LUCI_DEPENDS:=+kmod-fast-classifier +pdnsd-alt @LINUX_4_9
|
LUCI_DEPENDS:=+kmod-fast-classifier +pdnsd-alt @LINUX_4_9
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
PKG_VERSION:=1.0
|
PKG_VERSION:=1.0
|
||||||
PKG_RELEASE:=12
|
PKG_RELEASE:=10
|
||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ stop_pdnsd() {
|
|||||||
change_dns() {
|
change_dns() {
|
||||||
uci delete dhcp.@dnsmasq[0].server >/dev/null 2>&1
|
uci delete dhcp.@dnsmasq[0].server >/dev/null 2>&1
|
||||||
uci add_list dhcp.@dnsmasq[0].server=127.0.0.1#5333
|
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 set dhcp.@dnsmasq[0].noresolv=0
|
||||||
uci commit dhcp
|
uci commit dhcp
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,9 @@ uci -q batch <<-EOF >/dev/null
|
|||||||
commit ucitrack
|
commit ucitrack
|
||||||
EOF
|
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
|
[ ! -f /usr/sbin/dnscache ] && ln /usr/sbin/pdnsd /usr/sbin/dnscache
|
||||||
/etc/init.d/sfe enable
|
/etc/init.d/sfe enable
|
||||||
|
|
||||||
|
9
package/lean/luci-app-sfe/root/usr/share/dnscache-watchdog.sh
Executable file
9
package/lean/luci-app-sfe/root/usr/share/dnscache-watchdog.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user