Use cat instead of grep for listing our resolvconfs
[openresolv] / dnsmasq
diff --git a/dnsmasq b/dnsmasq
index c99bad05a540f1279e88fffcdd78274d124d74ca..8b104eca02ab00679f0dafe5db65bf4c095e9611 100755 (executable)
--- a/dnsmasq
+++ b/dnsmasq
@@ -51,7 +51,7 @@
 VARS="$(resolvconf -v)"
 eval "${VARS}"
 
 VARS="$(resolvconf -v)"
 eval "${VARS}"
 
-PREFIX=/
+PREFIX=
 DNSMASQRESOLV="${PREFIX}/etc/dnsmasq-resolv.conf"
 DNSMASQCONF="${PREFIX}/etc/dnsmasq-resolvconf.conf"
 
 DNSMASQRESOLV="${PREFIX}/etc/dnsmasq-resolv.conf"
 DNSMASQCONF="${PREFIX}/etc/dnsmasq-resolvconf.conf"
 
@@ -149,25 +149,9 @@ else
        printf "${NEWRESOLV}" > "${DNSMASQRESOLV}"
 fi
 
        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 ${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
-
+[ "${RELOAD}" = "yes" ] && resolvconf -s dnsmasq restart
 if [ "${DBUS}" = "yes" ]; then
 if [ "${DBUS}" = "yes" ]; then
-       if [ "${RELOAD}" != "yes" ]; then
-               if [ -x "${PREFIX}"/etc/init.d/dnsmasq ]; then
-                       /etc/init.d/dnsmasq ${INIT_EXTRA} reload
-               elif [ -x "${PREFIX}"/etc/rc.d/dnsmasq ]; then
-                       "${PREFIX}"/etc/rc.d/dnsmasq reload
-               fi
-       fi
+       [ "${RELOAD}" != "yes" ] && resolvconf -s dnsmasq reload
        # Send even if emtpy so old servers are cleared
        dbus-send --system --dest=uk.org.thekelleys.dnsmasq \
                /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers \
        # Send even if emtpy so old servers are cleared
        dbus-send --system --dest=uk.org.thekelleys.dnsmasq \
                /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers \