Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-testing > by-pkgid > 4944c8a09c6f43795060eae9de870687 > files > 4

fuse-2.7.3-4mdv2008.1.x86_64.rpm

#! /bin/sh
#
# fuse		Init script for Filesystem in Userspace
#
# Author:	Miklos Szeredi <miklos@szeredi.hu>
#
# chkconfig: 345 26 76
# description: Filesystem in Userspace
#
### BEGIN INIT INFO
# Provides: $remote_fs
# Required-Start: dkms $network
# Required-Stop: dkms $network
# Default-Start: 3 4 5
# Short-Description: Init script for Filesystem in Userspace.
# Description: Init script for Filesystem in Userspace.
### END INIT INFO

[ -r /etc/sysconfig/network ] || exit 0
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

[ -r /etc/init.d/functions ] || exit 0
. /etc/init.d/functions

MOUNTPOINT=/sys/fs/fuse/connections

# Gracefully exit if the package has been removed.
test -x /usr/bin/fusermount || exit 0

case "$1" in
  start)
	gprintf "Starting fuse: "
	if ! /bin/grep -qw fuse /proc/filesystems; then
		/sbin/modprobe fuse >/dev/null 2>&1
	fi
	if /bin/grep -qw fusectl /proc/filesystems && \
	   ! /bin/grep -qw $MOUNTPOINT /proc/mounts; then
		/bin/mount -t fusectl none $MOUNTPOINT >/dev/null 2>&1
	fi
	RETVAL=$?
	[ $RETVAL -eq 0 ] && success || failure
	echo
	[ $RETVAL -eq 0 ] && /bin/touch /var/lock/subsys/fuse
	;;
  stop)
	gprintf "Stopping fuse: "
	if /bin/grep -qw $MOUNTPOINT /proc/mounts; then
		/bin/umount $MOUNTPOINT >/dev/null 2>&1
	fi
	if /bin/grep -qw "^fuse" /proc/modules; then
		/sbin/rmmod fuse >/dev/null 2>&1
	fi
	RETVAL=$?
	[ $RETVAL -eq 0 ] && success || failure
        echo
	[ $RETVAL -eq 0 ] && /bin/rm -f /var/lock/subsys/fuse
	;;
  restart)
	$0 stop
	$0 start
	;;
  reload)
	$0 start
	;;
  status)
	if [ -e /var/lock/subsys/fuse ]; then
		gprintf "fuse is running\n"
	else
		gprintf "fuse is not running\n"
	fi
	if /bin/grep -qw fuse /proc/filesystems; then
		gprintf "fuse filesystem is supported\n"
	else
		gprintf "fuse filesystem is not supported\n"
	fi
	if /bin/grep -qw fusectl /proc/filesystems; then
		gprintf "fusectl filesystem is supported\n"
	else
		gprintf "fusectl filesystem is not supported\n"
	fi
	if /bin/grep -qw $MOUNTPOINT /proc/mounts; then
		gprintf "mount point %s exists\n" "$MOUNTPOINT"
	else
		gprintf "mount point %s does not exist\n" "$MOUNTPOINT"
	fi
	;;
  *)
        gprintf "Usage: %s\n" "$(basename $0) {start|stop|restart|reload|status}"
        exit 1
esac

exit 0