diff options
Diffstat (limited to 'etc/autofs/special_hosts')
-rw-r--r-- | etc/autofs/special_hosts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/etc/autofs/special_hosts b/etc/autofs/special_hosts new file mode 100644 index 0000000..f81449d --- /dev/null +++ b/etc/autofs/special_hosts @@ -0,0 +1,17 @@ +#!/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" \ + 'NR > 1 { printf "%s\t%s:%s ", $1, host, $1 } END { printf "\n" }' + |