diff options
Diffstat (limited to 'net-fs/autofs/files/auto.net')
-rw-r--r-- | net-fs/autofs/files/auto.net | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/net-fs/autofs/files/auto.net b/net-fs/autofs/files/auto.net new file mode 100644 index 000000000000..11bcc30e6bb8 --- /dev/null +++ b/net-fs/autofs/files/auto.net @@ -0,0 +1,30 @@ +#!/bin/sh +# $Id: auto.net,v 1.1 2004/12/09 07:25:12 robbat2 Exp $ + +# This file must be executable to work! chmod 755! + +# Look at what a host is exporting to determine what we can mount. +# This is very simple, but it appears to work surprisingly well + +key="$1" + +# add "nosymlink" here if you want to suppress symlinking local filesystems +# add "nonstrict" to make it OK for some filesystems to not mount +opts="-fstype=nfs,hard,intr,nodev,nosuid,nonstrict" + +# Showmount comes in a number of names and varieties. "showmount" is +# typically an older version which accepts the '--no-headers' flag +# but ignores it. "kshowmount" is the newer version installed with knfsd, +# which both accepts and acts on the '--no-headers' flag. +#SHOWMOUNT="kshowmount --no-headers -e $key" +#SHOWMOUNT="showmount -e $key | tail -n +2" + +# Newer distributions get this right +SHOWMOUNT="/usr/sbin/showmount --no-headers -e $key" + +$SHOWMOUNT | sort +0 | \ + awk -v key="$key" -v opts="$opts" -- ' + BEGIN { ORS=""; first=1 } + { if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 } + END { if (!first) print "\n"; else exit 1 } + ' |