summaryrefslogtreecommitdiff
blob: 8cdc630c1f56e4315b8961cf106e1acb75095926 (plain)
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
34
35
36
37
38
39
40
41
42
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

MOUNTPOINT=/sys/fs/fuse/connections

depend() {
	need localmount
}

start() {

	ebegin "Starting fuse"
	if ! grep -qw fuse /proc/filesystems; then
		modprobe fuse >/dev/null 2>&1 || eerror $? "Error loading fuse module"
	fi
	if grep -qw fusectl /proc/filesystems && \
	   ! grep -qw $MOUNTPOINT /proc/mounts; then
		mount -t fusectl none $MOUNTPOINT >/dev/null 2>&1 || \
			eerror $? "Error mounting control filesystem"
	fi
	eend ${?}
	
}

stop() {

	ebegin "Stopping fuse"
	if grep -qw $MOUNTPOINT /proc/mounts; then
		umount $MOUNTPOINT >/dev/null 2>&1 || \
			eerror $? "Error unmounting control filesystem"
	fi
	if grep -qw "^fuse" /proc/modules; then
		rmmod fuse >/dev/null 2>&1 || eerror $? "Error unloading fuse module"
	fi
	eend ${?}
	
}