3
# This file must be executable to work! chmod 755!
5
# Look at what a host is exporting to determine what we can mount.
6
# This is very simple, but it appears to work surprisingly well
10
# add "nosymlink" here if you want to suppress symlinking local filesystems
11
# add "nonstrict" to make it OK for some filesystems to not mount
12
opts="-fstype=nfs,hard,intr,nodev,nosuid"
14
# Showmount comes in a number of names and varieties. "showmount" is
15
# typically an older version which accepts the '--no-headers' flag
16
# but ignores it. "kshowmount" is the newer version installed with knfsd,
17
# which both accepts and acts on the '--no-headers' flag.
18
#SHOWMOUNT="kshowmount --no-headers -e $key"
19
#SHOWMOUNT="showmount -e $key | tail -n +2"
21
for P in /bin /sbin /usr/bin /usr/sbin
23
for M in showmount kshowmount
33
[ -x $SMNT ] || exit 1
35
# Newer distributions get this right
36
SHOWMOUNT="$SMNT --no-headers -e $key"
38
$SHOWMOUNT | LC_ALL=C sort -k 1 | \
39
awk -v key="$key" -v opts="$opts" -- '
40
BEGIN { ORS=""; first=1 }
41
{ if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 }
42
END { if (!first) print "\n"; else exit 1 }