diff options
Diffstat (limited to 'main/fuse/fuse.initd')
-rw-r--r-- | main/fuse/fuse.initd | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/main/fuse/fuse.initd b/main/fuse/fuse.initd new file mode 100644 index 0000000000..30b512e8dc --- /dev/null +++ b/main/fuse/fuse.initd | |||
@@ -0,0 +1,35 @@ | |||
1 | #!/sbin/runscript | ||
2 | # Copyright 1999-2007 Gentoo Foundation | ||
3 | # Distributed under the terms of the GNU General Public License v2 | ||
4 | |||
5 | MOUNTPOINT=/sys/fs/fuse/connections | ||
6 | |||
7 | depend() { | ||
8 | need localmount | ||
9 | } | ||
10 | |||
11 | start() { | ||
12 | |||
13 | ebegin "Starting fuse" | ||
14 | if ! grep -qw fuse /proc/filesystems; then | ||
15 | modprobe fuse >/dev/null 2>&1 || eerror $? "Error loading fuse module" | ||
16 | fi | ||
17 | if grep -qw fusectl /proc/filesystems && \ | ||
18 | ! grep -qw $MOUNTPOINT /proc/mounts; then | ||
19 | mount -t fusectl none $MOUNTPOINT >/dev/null 2>&1 || \ | ||
20 | eerror $? "Error mounting control filesystem" | ||
21 | fi | ||
22 | eend ${?} | ||
23 | |||
24 | } | ||
25 | |||
26 | stop() { | ||
27 | |||
28 | ebegin "Stopping fuse" | ||
29 | if grep -qw $MOUNTPOINT /proc/mounts; then | ||
30 | umount $MOUNTPOINT >/dev/null 2>&1 || \ | ||
31 | eerror $? "Error unmounting control filesystem" | ||
32 | fi | ||
33 | eend ${?} | ||
34 | |||
35 | } | ||