#! /bin/sh
# umountavfs -- program to unmount avfs file system
# and unload avfsd daemon.
# companion program to mountavfs
# will check to see if avfsd is mounted and then
# unmount using fusermount.
# last updated 2010-09-12

# suggested use: in a logout script or wm exit routine

if [ -d "$AVFSBASE" ]; then
    MntDir="$AVFSBASE"
else
    MntDir="${HOME}/.avfs"
fi

grep -q "avfsd ${MntDir}" /proc/mounts && {
   echo unMounting AVFS on $MntDir...
   fusermount -u "$MntDir"
}

