9 # Short-Description: Start and stop fuse.
10 # Description: Load the fuse module and mount the fuse control
16 PATH
=/usr
/local
/sbin
:/usr
/local
/bin
:/sbin
:/bin
:/usr
/sbin
:/usr
/bin
17 MOUNTPOINT
=/sys
/fs
/fuse
/connections
19 # Gracefully exit if the package has been removed.
20 which fusermount
&>/dev
/null ||
exit 5
23 start|restart|force-reload
)
24 if ! grep -qw fuse
/proc
/filesystems
; then
25 echo -n "Loading fuse module"
26 if ! modprobe fuse
>/dev
/null
2>&1; then
33 echo "Fuse filesystem already available."
35 if grep -qw fusectl
/proc
/filesystems
&& \
36 ! grep -qw $MOUNTPOINT /proc
/mounts
; then
37 echo -n "Mounting fuse control filesystem"
38 if ! mount
-t fusectl fusectl
$MOUNTPOINT >/dev
/null
2>&1; then
45 echo "Fuse control filesystem already available."
49 if ! grep -qw fuse
/proc
/filesystems
; then
50 echo "Fuse filesystem not loaded."
53 if grep -qw $MOUNTPOINT /proc
/mounts
; then
54 echo -n "Unmounting fuse control filesystem"
55 if ! umount
$MOUNTPOINT >/dev
/null
2>&1; then
61 echo "Fuse control filesystem not mounted."
63 if grep -qw "^fuse" /proc
/modules
; then
64 echo -n "Unloading fuse module"
65 if ! rmmod fuse
>/dev
/null
2>&1; then
71 echo "Fuse module not loaded."
75 echo -n "Checking fuse filesystem"
76 if ! grep -qw fuse
/proc
/filesystems
; then
77 echo " not available."
84 echo "Usage: $0 {start|stop|restart|force-reload|status}"