X-Git-Url: https://roy.marples.name/git diff --git a/dnsmasq b/dnsmasq index a0f852f..dbc6815 100755 --- a/dnsmasq +++ b/dnsmasq @@ -64,7 +64,7 @@ NEWRESOLV="${NEWCONF}" # so we need to validate a few things first. # Check for DBus support in the binary DBUS=no -if [ -s "${PREFIX}"/var/run/dbus.pid -a "${PREFIX}"/var/run/dnsmasq.pid ]; then +if [ -s "${PREFIX}"/var/run/dbus.pid -a -s "${PREFIX}"/var/run/dnsmasq.pid ]; then if dnsmasq --version 2>/dev/null | \ grep -q "^Compile time options.*[[:space:]]DBus[[:space:]]" \ ; then @@ -149,10 +149,13 @@ else printf "${NEWRESOLV}" > "${DNSMASQRESOLV}" fi +[ -x /sbin/runscript ] && INIT_EXTRA="--quiet --nodeps" + if [ "${RELOAD}" = "yes" ]; then if [ -x "${PREFIX}"/etc/init.d/dnsmasq ]; then - /etc/init.d/dnsmasq --quiet --nodeps conditionalrestart - elif [ -x "${PREFIX}"/etc/rc.d/dnsmasq ]; then + /etc/init.d/dnsmasq ${INIT_EXTRA} conditionalrestart + elif [ -x "${PREFIX}"/etc/rc.d/dnsmasq -a -s /var/run/dnsmasq.pid ]; then + kill -0 $(cat /var/run/dnsmasq.pid) && \ "${PREFIX}"/etc/rc.d/dnsmasq restart fi fi @@ -160,7 +163,7 @@ fi if [ "${DBUS}" = "yes" ]; then if [ "${RELOAD}" != "yes" ]; then if [ -x "${PREFIX}"/etc/init.d/dnsmasq ]; then - /etc/init.d/dnsmasq --quiet reload + /etc/init.d/dnsmasq ${INIT_EXTRA} reload elif [ -x "${PREFIX}"/etc/rc.d/dnsmasq ]; then "${PREFIX}"/etc/rc.d/dnsmasq reload fi