Added prebuild to vi PKGBUILD
[Archlinux-Stable.git] / support / fuse / fuse.rc.d
blob768da5b02d53eed4abaa0678395d28d721a939ea
1 #!/bin/bash
3 # fuse Init script for Filesystem in Userspace
4 # Based on the script by Miklos Szeredi <miklos@szeredi.hu>
6 . /etc/rc.conf
7 . /etc/rc.d/functions
8 FUSECTL=/sys/fs/fuse/connections
10 case "$1" in
11 start)
12 stat_busy "Starting fuse"
13 if ! grep -qw fuse /proc/filesystems; then
14 modprobe fuse >/dev/null 2>&1
15 if [ $? -gt 0 ]; then
16 stat_fail
17 exit 1
20 if grep -qw fusectl /proc/filesystems && ! grep -qw $FUSECTL /proc/mounts; then
21 mount -t fusectl none $FUSECTL >/dev/null 2>&1
22 if [ $? -gt 0 ]; then
23 stat_fail
24 exit 1
27 add_daemon fuse
28 stat_done
30 stop)
31 stat_busy "Stopping fuse"
32 umount $FUSECTL >/dev/null 2>&1
33 rmmod fuse >/dev/null 2>&1
34 if [ $? -gt 0 ]; then
35 stat_fail
36 else
37 rm_daemon fuse
38 stat_done
41 restart)
42 $0 stop
43 sleep 1
44 $0 start
46 *)
47 echo "usage: $0 {start|stop|restart}"
48 esac
49 exit 0