#!/bin/sh
#
# ltspfs	Setup FUSE for ltspfs
#
# chkconfig: 345 12 88
# description:	Make sure ltspfs can work

# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
RETVAL=0

# Source function library.
. /etc/init.d/functions

check() { [ "`control fusermount 2>/dev/null`" = "public" ]; }
start() { modprobe fuse && check && chmod a+rw /dev/fuse ||:; }
stop() { chmod o-rw /dev/fuse; }

# See how we were called.
case "$1" in
	start) start;;
	stop)  stop;;
	reload|restart|condstop|condrestart|condreload) ;;
	status) ls -l /dev/fuse;;
	*)
		msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
		RETVAL=1;;
esac

exit $RETVAL
