Check whether avahi-daemon is started

This commit is contained in:
David Paleino 2009-06-20 09:14:08 +02:00
parent ab36c8d29d
commit 1e532f0f2b

View File

@ -1193,11 +1193,14 @@ _known_hosts_real()
fi fi
# Add hosts reported by avahi, if it's available # Add hosts reported by avahi, if it's available
# and if the daemon is started.
if type avahi-browse >&/dev/null; then if type avahi-browse >&/dev/null; then
if [ -z "$(pidof avahi-daemon)" ]; then
COMPREPLY=( "${COMPREPLY[@]}" $( COMPREPLY=( "${COMPREPLY[@]}" $(
compgen -W "$( avahi-browse -kcpr _workstation._tcp | \ compgen -W "$( avahi-browse -kcpr _workstation._tcp | \
grep ^= | cut -d\; -f7 | sort -u )" -- $cur ) ) grep ^= | cut -d\; -f7 | sort -u )" -- $cur ) )
fi fi
fi
# Now add results of normal hostname completion # Now add results of normal hostname completion
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -A hostname -- $cur ) ) COMPREPLY=( "${COMPREPLY[@]}" $( compgen -A hostname -- $cur ) )