Debian Codegraph @

scripts/mountavfs

raw
1 #!/bin/bash
2 # mountavfs -- program to mount avfs file system
3 # and load avfsd daemon.
4 # companion program to umountavfs
5 # will check to see if avfs is mounted and then
6 # load the avfsd daemon which will mount avfs.
7 #
8 # you can source this file in the login script to automatically make
9 # AVFS available. The base directory mount point is exported as
10 # AVFSBASE.
11 #
12
13 # if unset or not pointing to a directory, revert to default mount point
14 if [ ! -d "$AVFSBASE" ]; then
15 AVFSBASE="${HOME}/.avfs"
16 fi
17
18 grep -qE "avfsd ${AVFSBASE}" /proc/mounts || {
19 if [ ! -e "$AVFSBASE" ]; then
20 mkdir -p "$AVFSBASE"
21 fi
22 if [ ! -d "$AVFSBASE" ]; then
23 echo "$AVFSBASE exists but is no directory"
24 exit 1
25 fi
26 echo Mounting AVFS on $AVFSBASE...
27 avfsd "$AVFSBASE"
28 while test ! -e "$AVFSBASE/#avfsstat/symlink_rewrite"
29 do sleep 0.5 ; done
30 echo "1" >| "$AVFSBASE/#avfsstat/symlink_rewrite"
31
32 export AVFSBASE
33 }