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
}
|