#!/bin/bash
opt=""
if [ $# -gt 0 ]; then
if [ $1 = "-f" ]; then opt=$1; shift; fi
fi

if [ $# = 0 ]; then echo Usage: "$0 [-f] <host>..."; exit 1; fi
PATH="$PATH:/usr/local/bin"
while [ $# != 0 ];
do
grep "\bnfs\b" /etc/fstab | grep "[ 	]/$1[/ ]" | sed -e 's/[^ 	]*[ 	]\([^ 	]*\).*/\1/' | xargs --replace=% snfsumount $opt %
shift;
done
rm -f /var/run/snfs/snfs.$1.pid
rm -f ~/.snfs/snfs.$1.pid

