X-Git-Url: https://roy.marples.name/git diff --git a/dnsmasq.in b/dnsmasq.in index ccb5e3f..2de1f3b 100755 --- a/dnsmasq.in +++ b/dnsmasq.in @@ -1,5 +1,4 @@ #!/bin/sh -# Copyright 2006 Gentoo Foundation # Copyright 2007 Roy Marples # All rights reserved @@ -37,15 +36,17 @@ # This allows dnsmasq to forward domains for a specific VPN domain to the # VPN nameserver and everything else to the standard name servers. -# A sample dnsmasq config that works as above is like so +# A sample dnsmasq config that works as above is like so. +# NOTE: The loopback interface on some systems maybe lo0. #domain-needed #interface=lo #resolv-file=/etc/dnsmasq-resolv.conf #conf-file=/etc/dnsmasq-resolvconf.conf # The last step is to configure dns configuration for /etc/resolv.conf -# for the lo interface. In Gentoo we set it up like so in /etc/conf.d/net -#dns_servers_lo="127.0.0.1" +# for the lo interface. You can do this in resolvconf as well by adding +#nameserver 127.0.0.1 +# to resolv.conf.d/base # Load our variables from resolvconf VARS="$(resolvconf -v)" @@ -71,8 +72,8 @@ if [ -s "${dbuspid}" -a -s /var/run/dnsmasq.pid ]; then grep -q "^Compile time options.*[[:space:]]DBus[[:space:]]" \ ; then # Sanity - check that dnsmasq and dbus are running - if kill -0 $(cat "${dbuspid}") \ - && kill -0 $(cat /var/run/dnsmasq.pid); then + if kill -0 $(cat "${dbuspid}") 2>/dev/null \ + && kill -0 $(cat /var/run/dnsmasq.pid) 2>/dev/null; then DBUS=yes NEWCONF="${NEWCONF}\n# Domain specific servers will be sent over dbus\nenable-dbus\n" fi @@ -121,9 +122,9 @@ for DN in $(uniqify ${NEWDOMAIN}); do set -- ${IP} NUM="0x$(printf "%02x" $1 $2 $3 $4)" if [ "${SIFS}" = "y" ]; then - IFS=$OIFS - else unset IFS + else + IFS=$OIFS fi DBUSDEST="${DBUSDEST} uint32:$(printf "%d" ${NUM}) string:${DN%,*}" else @@ -159,5 +160,3 @@ if [ "${DBUS}" = "yes" ]; then /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetServers \ ${DBUSDEST} fi - -# vim: ts=4 :