Fix pdnsd for printf(1)
authorRoy Marples <roy@marples.name>
Mon, 13 Jun 2011 13:33:22 +0000 (13:33 +0000)
committerRoy Marples <roy@marples.name>
Mon, 13 Jun 2011 13:33:22 +0000 (13:33 +0000)
More for #14

pdnsd.in

index 237939ca9b5dd8cb2efa01885660c25d7c2b9060..5fbe2a076a579c4209a76363a9926f9f0893510a 100644 (file)
--- a/pdnsd.in
+++ b/pdnsd.in
@@ -30,6 +30,8 @@
 . "@SYSCONFDIR@/resolvconf.conf" || exit 1
 [ -z "$pdnsd_conf" -a -z "$pdnsd_resolv" ] && exit 0
 [ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)"
+NL="
+"
 
 : ${pdnsd_restart:=pdnsd-ctl config $pdnsd_conf}
 signature="# Generated by resolvconf"
@@ -94,10 +96,10 @@ if [ -n "$pdnsd_conf" ]; then
        newconf=
 
        if [ -z "$pdnsd_resolv" ]; then
-               newconf="${newconf}server {\n"
-               newconf="${newconf}\tlabel=resolvconf;\n"
+               newconf="${newconf}server {$NL"
+               newconf="${newconf}     label=resolvconf;$NL"
                if [ -n "$NAMESERVERS" ]; then
-                       newconf="${newconf}\tip="
+                       newconf="${newconf}     ip="
                        first=true
                        for n in $NAMESERVERS; do
                                if $first; then
@@ -107,16 +109,16 @@ if [ -n "$pdnsd_conf" ]; then
                                fi
                                newconf="$newconf$n"
                        done
-                       newconf="${newconf};\n"
+                       newconf="${newconf};$NL"
                fi
-               newconf="${newconf}}\n"
+               newconf="${newconf}}$NL"
        fi
 
        for d in $DOMAINS; do
-               newconf="${newconf}server {\n"
-               newconf="${newconf}\tinclude=.${d%%:*}.;\n"
-               newconf="${newconf}\tpolicy=excluded;\n"
-               newconf="${newconf}\tip="
+               newconf="${newconf}server {$NL"
+               newconf="${newconf}     include=.${d%%:*}.;$NL"
+               newconf="${newconf}     policy=excluded;$NL"
+               newconf="${newconf}     ip="
                ns="${d#*:}"
                while [ -n "$ns" ]; do
                        newconf="${newconf}${ns%%,*}"
@@ -124,7 +126,7 @@ if [ -n "$pdnsd_conf" ]; then
                        ns="${ns#*,}"
                        newconf="${newconf},"
                done
-               newconf="${newconf};\n}\n"
+               newconf="${newconf};$NL}$NL"
        done
 
        rm -f "$cf"