Don't restart dnsmasq needlessly.
[openresolv] / configure
index 70ec104d12d1dd80a64cfb193c1fcda495103df5..23f49a348c8a7f266c15281415ecddfe89dd6536 100755 (executable)
--- a/configure
+++ b/configure
@@ -7,8 +7,9 @@ BUILD=
 HOST=
 TARGET=
 RESTARTCMD=
+RCDIR=
 
-for x; do
+for x do
        opt=${x%%=*}
        var=${x#*=}
        case "$opt" in
@@ -45,14 +46,14 @@ done
 : ${PREFIX:=$prefix}
 : ${SYSCONFDIR:=$PREFIX/etc}
 : ${SBINDIR:=$PREFIX/sbin}
-: ${LIBEXECDIR:=$PREFIX/libexec}
+: ${LIBEXECDIR:=$PREFIX/libexec/resolvconf}
 : ${STATEDIR:=/var}
 : ${RUNDIR:=$STATEDIR/run}
 : ${MANDIR:=${PREFIX:-/usr}/share/man}
 
 eval SYSCONFDIR="$SYSCONFDIR"
 eval SBINDIR="$SBINDIR"
-eval LIBEXECDIR="$LIBEXECDIR/resolvconf"
+eval LIBEXECDIR="$LIBEXECDIR"
 eval VARDIR="$RUNDIR/resolvconf"
 eval MANDIR="$MANDIR"
 
@@ -119,6 +120,7 @@ done
 
 if [ -e /etc/arch-release -a -d /etc/rc.d ]; then
        echo "Overriding service status check for Arch Linux"
+       RCDIR=/etc/rc.d
        RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart"
        echo "yes"
 fi
@@ -126,7 +128,7 @@ fi
 if [ -z "$RESTARTCMD" ]; then
        printf "Checking for OpenRC ... "
        if [ -x /sbin/rc-service ]; then
-               RESTARTCMD="/sbin/rc-service -e \1 \&\& /sbin/rc-service \1 -Ds restart"
+               RESTARTCMD="/sbin/rc-service -e \1 \&\& /sbin/rc-service \1 -- -Ds restart"
                echo "yes"
        else
                echo "no"
@@ -135,7 +137,8 @@ fi
 if [ -z "$RESTARTCMD" ]; then
        printf "Checking for invoke-rc.d ... "
        if [ -x /usr/sbin/invoke-rc.d ]; then
-               RESTARTCMD="/usr/sbin/invoke-rc.d --query --quiet \1 restart || [ \$\$\? = 104 ] \&\& /usr/sbin/invoke-rc.d \1 restart"
+               RCDIR=/etc/init.d
+               RESTARTCMD="/usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1 \&\& /usr/sbin/invoke-rc.d \1 restart"
                echo "yes"
        else
                echo "no"
@@ -144,6 +147,7 @@ fi
 if [ -z "$RESTARTCMD" ]; then
        printf "Checking for service ... "
        if [ -x /sbin/service ]; then
+               RCDIR=/etc/init.d
                RESTARTCMD="/sbin/service \1 \&\& /sbin/service \1 restart"
                echo "yes"
        else
@@ -154,7 +158,8 @@ if [ -z "$RESTARTCMD" ]; then
        for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do
                printf "Checking for $x ... "
                if [ -d $x ]; then
-                       RESTARTCMD="$x/\1 status >/dev/null 2>&1 \&\& $x/\1 restart"
+                       RCDIR=$x
+                       RESTARTCMD="$x/\1 status >/dev/null 2>\&1 \&\& $x/\1 restart"
                        echo "yes"
                        break
                else
@@ -168,8 +173,9 @@ if [ -z "$RESTARTCMD" ]; then
        exit 1
 fi
 
+echo "RCDIR=           $RCDIR" >>$CONFIG_MK
 # Work around bug in the dash shell as "echo 'foo \1'" does bad things
-printf "%s\n" "RESTARTCMD=     ${RESTARTCMD}" >>$CONFIG_MK
+printf "%s\n" "RESTARTCMD=     $RESTARTCMD" >>$CONFIG_MK
 
 echo
 echo "   SYSCONFDIR =          $SYSCONFDIR"