diff options
author | Stefan Schweizer <genstef@gentoo.org> | 2007-01-24 07:31:00 +0000 |
---|---|---|
committer | Stefan Schweizer <genstef@gentoo.org> | 2007-01-24 07:31:00 +0000 |
commit | 199acd2665ff17c1f75ac302569a5a725356f3f7 (patch) | |
tree | 3d5565a634b7af45a0f79baed59ad61b62541266 /sys-fs/fuse/files | |
parent | Clean up. (diff) | |
download | gentoo-2-199acd2665ff17c1f75ac302569a5a725356f3f7.tar.gz gentoo-2-199acd2665ff17c1f75ac302569a5a725356f3f7.tar.bz2 gentoo-2-199acd2665ff17c1f75ac302569a5a725356f3f7.zip |
Gentooify init script thanks to David B. Ferguson <david@microtask.ca>
(Portage version: 2.1.2_rc4-r8)
Diffstat (limited to 'sys-fs/fuse/files')
-rw-r--r-- | sys-fs/fuse/files/fuse.init | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sys-fs/fuse/files/fuse.init b/sys-fs/fuse/files/fuse.init new file mode 100644 index 000000000000..c9322cd83044 --- /dev/null +++ b/sys-fs/fuse/files/fuse.init @@ -0,0 +1,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 || echo "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 ${?} + +} + + + + |