File: umountavfs

package info (click to toggle)
avfs 1.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,916 kB
  • sloc: ansic: 31,364; sh: 6,482; perl: 1,916; makefile: 351
file content (27 lines) | stat: -rw-r--r-- 678 bytes parent folder | download | duplicates (2)
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
}