Support gmake-3 and gmake-4
[openresolv] / unbound.in
index 839a85944059e6bb5d62578159a7e046b678ac53..633c7f0dffc1f3feb8d929fbfbac7a026a6024f6 100644 (file)
@@ -29,7 +29,7 @@
 [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0
 . "@SYSCONFDIR@/resolvconf.conf" || exit 1
 [ -z "$unbound_conf" ] && exit 0
-[ -z "$RESOLVCONF" ] && eval "$(@PREFIX@/sbin/resolvconf -v)"
+[ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)"
 NL="
 "
 
@@ -56,6 +56,13 @@ if [ -n "$NAMESERVERS" ]; then
        done
 fi
 
+# Try to ensure that config dirs exist
+if type config_mkdirs >/dev/null 2>&1; then
+       config_mkdirs "$unbound_conf"
+else
+       @SBINDIR@/resolvconf -D "$unbound_conf"
+fi
+
 if [ ! -f "$unbound_conf" ] || \
        [ "$(cat "$unbound_conf")" != "$(printf %s "$newconf")" ]
 then