summaryrefslogtreecommitdiffstats
path: root/etc/autofs/special_hosts
blob: f81449d43107567c61485bf6d579ea9aa01b7396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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" }'

OpenPOWER on IntegriCloud