Hello Michaels! On Sat, Jan 03, 2015 at 01:20:11AM +0100, Michael Biebl wrote: > please send a patch
Completely untested patch attached. The patch prefers ip(route2), then net-tools and if neither is available it should give some kind of graceful degradation. Thus no need to adjust dependencies. Help with testing from anyone interested would be appreciated. Regards, Andreas Henriksson
--- debian/avahi-daemon-check-dns.sh.orig 2015-04-07 17:16:27.343865571 +0200 +++ debian/avahi-daemon-check-dns.sh 2015-04-07 17:16:32.480014479 +0200 @@ -31,12 +31,17 @@ # If there is no local nameserver and no we have no global ip addresses # then we can't reach any nameservers if ! $(egrep -q "nameserver 127.0.0.1|::1" /etc/resolv.conf); then - # Get addresses of all running interfaces - ADDRS=$(LC_ALL=C ifconfig | grep ' addr:') - # Filter out all local addresses - ADDRS=$(echo "${ADDRS}" | egrep -v ':127|Scope:Host|Scope:Link') - # Check we have a default route - ROUTES=$(route -n | grep '^0.0.0.0 ') + if [ -x "$(which ip)" ]; then + ADDRS=$(ip addr show scope global | grep inet) + ROUTES=$(ip route show 0.0.0.0/0) + elif [ -x "$(which ifconfig)" -a -x "$(which route)" ]; then + # Get addresses of all running interfaces + ADDRS=$(LC_ALL=C ifconfig | grep ' addr:') + # Filter out all local addresses + ADDRS=$(echo "${ADDRS}" | egrep -v ':127|Scope:Host|Scope:Link') + # Check we have a default route + ROUTES=$(route -n | grep '^0.0.0.0 ') + fi if [ -z "${ADDRS}" -o -z "${ROUTES}" ] ; then return 1; fi