1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-28 11:57:28 +00:00
freebsd/etc/autofs/special_hosts

18 lines
302 B
Plaintext
Raw Normal View History

#!/bin/sh
#
# $FreeBSD$
#
if [ $# -eq 0 ]; then
out=`getent hosts`
[ $? -eq 0 ] || exit 1
echo "$out" | awk '{ print $2 }' | sort -u
exit 0
fi
out=`showmount -E "$1"`
[ $? -eq 0 ] || exit 1
echo "$out" | awk -v host="$1" \
'{ printf "\"%s\"\t\"%s:%s\" ", $0, host, $0 } END { printf "\n" }'