Rev 192 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash# 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 wellkey="$1"# add "nosymlink" here if you want to suppress symlinking local filesystems# add "nonstrict" to make it OK for some filesystems to not mountopts="-fstype=nfs,hard,nodev,nosuid"for P in /bin /sbin /usr/bin /usr/sbindofor M in showmount kshowmountdoif [ -x $P/$M ]thenSMNT=$P/$Mbreak 2fidonedone[ -x $SMNT ] || exit 1# Newer distributions get this rightSHOWMOUNT="$SMNT --no-headers -e $key"$SHOWMOUNT | LC_ALL=C cut -d' ' -f1 | LC_ALL=C sort -u | \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 }' | sed 's/#/\\#/g'