pdns_recursor: Fix global forwarders
authorRoy Marples <roy@marples.name>
Sun, 8 Sep 2019 18:01:22 +0000 (19:01 +0100)
committerRoy Marples <roy@marples.name>
Sun, 8 Sep 2019 18:01:22 +0000 (19:01 +0100)
This actually makes it useful now and is finally included in
the default installation.

pdns_recursor.in

index ad2d922dc4de094a9c12db6f905f935052b30821..f3632e0003855c4cc8affb593804a1f5ef94fabe 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2009-2011 Roy Marples
+# Copyright (c) 2009-2019 Roy Marples
 # All rights reserved
 
 # PowerDNS Recursor subscriber for resolvconf
 NL="
 "
 
-: ${pdns_service:=pdns_recursor}
+: ${pdns_service:=pdns-recursor}
 
 newzones=
 
-# pds_recursor does not present support global forward servers, which
-# does limit it's usefulness somewhat.
-# If it did, the below code can be enabled, or something like it.
-#for n in $NAMESERVERS; do
-#      newzones="$newzones${newzones:+,}$n"
-#done
-#[ -n "$newzones" ] && newzones=".=$newzones$NL"
+for n in $NAMESERVERS; do
+       newzones="$newzones${newzones:+,}$n"
+done
+[ -n "$newzones" ] && newzones="+.=$newzones$NL"
 
 for d in $DOMAINS; do
        newns=
@@ -71,7 +68,7 @@ then
                eval $pdns_restart
        elif [ -n "$RESTARTCMD" ]; then
                set -- ${pdns_service}
-               eval $RESTARTCMD
+               eval "$RESTARTCMD"
        else
                @SBINDIR@/resolvconf -r ${pdns_service}
        fi