From: <abe...@us...> - 2015-01-25 21:31:47
|
Revision: 6940 http://sourceforge.net/p/astlinux/code/6940 Author: abelbeck Date: 2015-01-25 21:31:43 +0000 (Sun, 25 Jan 2015) Log Message: ----------- dnsmasq, new defaults of cache-size=4096 and dns-forward-max=512, allow /etc/dnsmasq.static to override either default Modified Paths: -------------- branches/1.0/package/dnsmasq/dnsmasq.init Modified: branches/1.0/package/dnsmasq/dnsmasq.init =================================================================== --- branches/1.0/package/dnsmasq/dnsmasq.init 2015-01-25 20:21:20 UTC (rev 6939) +++ branches/1.0/package/dnsmasq/dnsmasq.init 2015-01-25 21:31:43 UTC (rev 6940) @@ -27,6 +27,18 @@ echo "$prefix" } +directive_exists_with_file() { + local directive="$1" file="$2" + + if [ -f "$file" ]; then + if grep -q "^${directive} *=" "$file"; then + return 0 + fi + fi + + return 1 +} + dnscrypt_proxy_check() { if [ -f /etc/init.d/dnscrypt ]; then @@ -201,9 +213,16 @@ ${local_domain}bogus-priv ${local_domain}local=/$DOMAIN/ expand-hosts -domain=$DOMAIN -cache-size=2048" +domain=$DOMAIN" + # Some directives can only be defined once + if ! directive_exists_with_file "cache-size" /etc/dnsmasq.static; then + echo "cache-size=4096" + fi + if ! directive_exists_with_file "dns-forward-max" /etc/dnsmasq.static; then + echo "dns-forward-max=512" + fi + if dnscrypt_proxy_check; then echo "no-resolv server=127.0.0.1#2053 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |