1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
#!/bin/bash
# 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.
# suggested use: in a logout script or wm exit routine
# if unset or not pointing to a directory, revert to default mount point
if [ ! -d "$AVFSBASE" ]; then
AVFSBASE="${HOME}/.avfs"
fi
grep -qE "avfsd ${AVFSBASE}" /proc/mounts && {
echo unMounting AVFS on $AVFSBASE...
if type -p fusermount > /dev/null 2>&1 ; then
fusermount -u -z "$AVFSBASE"
else
umount -l "$AVFSBASE"
fi
# Remove directory again
rmdir ${AVFSBASE}
unset AVFSBASE
}
|