aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/autofs/autofs/special_hosts
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/autofs/autofs/special_hosts')
-rw-r--r--usr.sbin/autofs/autofs/special_hosts17
1 files changed, 17 insertions, 0 deletions
diff --git a/usr.sbin/autofs/autofs/special_hosts b/usr.sbin/autofs/autofs/special_hosts
new file mode 100644
index 000000000000..c49854681451
--- /dev/null
+++ b/usr.sbin/autofs/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" \
+ '{ printf "\"%s\"\t\"%s:%s\" ", $0, host, $0 } END { printf "\n" }'
+