fff-dhcp: increase dns cachesize from 150 to 8k #28

Closed
jkimmel wants to merge 1 commits from jkimmel/firmware:dnsmasq-cache into master
1 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,10 @@
# Use a larger cachesize by default
cachesize=1024
# Increase cachesize for systems with enough memory
mem="$(awk '/^MemTotal:/ {print $2}' /proc/meminfo)"
[ "$mem" -gt 65536 ] && cachesize=8192
uci batch >/dev/null <<EOF
delete dhcp.@dnsmasq[0]
delete dhcp.lan
@ -12,6 +19,7 @@ uci batch >/dev/null <<EOF
set dhcp.@dnsmasq[-1].domain='fff.community'
set dhcp.@dnsmasq[-1].expandhosts='0'
set dhcp.@dnsmasq[-1].nonegcache='0'
set dhcp.@dnsmasq[-1].cachesize="$cachesize"
set dhcp.@dnsmasq[-1].authoritative='1'
set dhcp.@dnsmasq[-1].readethers='1'
set dhcp.@dnsmasq[-1].leasefile='/tmp/dhcp.leases'