Rejig our Makefile to better support NetBSD. We now talk to /var/run/resolvconf direc...
[openresolv] / resolvconf.in
index bb2e53d08b34d416317c069f1a77d46da0b6cc84..dc6f335e2f025da5a08689523fc62edb6ebd41c3 100755 (executable)
 
 ARGV0="$0"
 
 
 ARGV0="$0"
 
-PREFIX=
-RESOLVCONF="${PREFIX}"/etc/resolvconf
-UPDATED="${RESOLVCONF}"/update.d
-VARDIR="${RESOLVCONF}"/run
+SYSCONFDIR=@SYSCONFDIR@
+VARDIR=@VARBASE@/run/resolvconf
 IFACEDIR="${VARDIR}/interfaces"
 
 error_exit() {
 IFACEDIR="${VARDIR}/interfaces"
 
 error_exit() {
@@ -149,8 +147,8 @@ if [ "${CMD}" = "l" -o "${CMD}" = "i" ]; then
        if [ -n "${ARGS}" ]; then
                LIST="${ARGS}"
                ${FORCE} || REPORT=true
        if [ -n "${ARGS}" ]; then
                LIST="${ARGS}"
                ${FORCE} || REPORT=true
-       elif [ -r "${RESOLVCONF}"/interface-order ]; then
-               LIST="$(cat "${RESOLVCONF}"/interface-order)"
+       elif [ -r "${SYSCONFDIR}"/interface-order ]; then
+               LIST="$(cat "${SYSCONFDIR}"/interface-order)"
        fi
 
        # If we don't have a list then prefer lo, tunnels, ppp
        fi
 
        # If we don't have a list then prefer lo, tunnels, ppp
@@ -312,7 +310,7 @@ if [ "${CMD}" = "a" ]; then
 fi
 
 RETVAL=0
 fi
 
 RETVAL=0
-for SCRIPT in "${UPDATED}"/*; do
+for SCRIPT in "${SYSCONFDIR}"/update.d/*; do
        if [ -e "${SCRIPT}" ]; then
                "${SCRIPT}" "${CMD}" "${IFACE}"
                RETVAL=$((${RETVAL} + $?))
        if [ -e "${SCRIPT}" ]; then
                "${SCRIPT}" "${CMD}" "${IFACE}"
                RETVAL=$((${RETVAL} + $?))