summaryrefslogtreecommitdiffstats
path: root/etc/autofs/special_noauto
blob: 219ec7ea699403f75457f6b7775d9e6a070fe933 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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

OpenPOWER on IntegriCloud