aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/autofs/autofs/special_noauto
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/autofs/autofs/special_noauto')
-rwxr-xr-xusr.sbin/autofs/autofs/special_noauto29
1 files changed, 29 insertions, 0 deletions
diff --git a/usr.sbin/autofs/autofs/special_noauto b/usr.sbin/autofs/autofs/special_noauto
new file mode 100755
index 000000000000..219ec7ea6994
--- /dev/null
+++ b/usr.sbin/autofs/autofs/special_noauto
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+print_available() {
+ sed 's/#.*//' /etc/fstab | awk '$4 ~ /noauto/ { print $2 }'
+}
+
+print_one() {
+ local _mntpoint
+
+ _mntpoint="${1%/}"
+
+ sed 's/#.*//' /etc/fstab | awk '
+ $2 == "'"${_mntpoint}"'" && $4 ~ /noauto/ {
+ if ($1 ~ /:/) { dev=$1 } else { dev=":"$1 }
+ print "-fstype=" $3 "," $4, dev
+ }'
+}
+
+if [ $# -eq 0 ]; then
+ print_available
+ exit 0
+fi
+
+print_one "$1"
+exit 0
+