Try to ensure that the directories our config files want to live in exist.
[openresolv] / pdnsd.in
index 5fbe2a076a579c4209a76363a9926f9f0893510a..f474196ef4c9237cea17ccbbdc550a7cd764a38a 100644 (file)
--- a/pdnsd.in
+++ b/pdnsd.in
@@ -85,6 +85,13 @@ change_file()
 newresolv="# Generated by resolvconf\n"
 changed=false
 
+# Try to ensure that config dirs exist
+if type config_mkdirs >/dev/null 2>&1; then
+       config_mkdirs "$pdnsd_resolv" "$pdnsd_conf"
+else
+       @PREFIX@/sbin/resolvconf -D "$pdnsd_resolv" "$pdnsd_conf"
+fi
+
 if [ -n "$pdnsd_resolv" ]; then
        for n in $NAMESERVERS; do
                newresolv="${newresolv}nameserver $n\n"