File: mountavfs

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 (33 lines) | stat: -rwxr-xr-x 930 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
28
29
30
31
32
33
#!/bin/bash
# mountavfs -- program to mount avfs file system
# and load avfsd daemon.
# companion program to umountavfs
# will check to see if avfs is mounted and then
# load the avfsd daemon which will mount avfs.
#
# you can source this file in the login script to automatically make
# AVFS available. The base directory mount point is exported as
# AVFSBASE.
#

# 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 || {
   if [ ! -e "$AVFSBASE" ]; then
      mkdir -p "$AVFSBASE"
   fi
   if [ ! -d "$AVFSBASE" ]; then
      echo "$AVFSBASE exists but is no directory"
      exit 1
   fi
   echo Mounting AVFS on $AVFSBASE...
   avfsd "$AVFSBASE"
   while test ! -e "$AVFSBASE/#avfsstat/symlink_rewrite"
   do sleep 0.5 ; done
   echo "1" >| "$AVFSBASE/#avfsstat/symlink_rewrite"

   export AVFSBASE
}