#!/bin/bash


. /bin/network-functions

PIDFILE=/var/run/chtmpf.pid

SERVICE=chtmpfs
PROCESS_NAME=chtmpf

do_start ()
{
	/etc/init.d/softdogd wait
	
	if ! ServiceCheckRunning1 ; then
		return $?
	fi

#	echo -n $"Starting demo featurekey checking daemon: "
	/bin/setsid /bin/chtmpf > /dev/null 2>&1 &
	echo $! > $PIDFILE

	ServiceCheckRunning2
	return $?
}

do_stop ()
{
	/etc/init.d/softdogd wait
#	echo -n $"Shut down featurekey checking daemon: "
	ServiceStop
	return $?
}

do_status ()
{
	ServiceStatus
	return $?
}

case "$1" in
	start)
		do_start
		;;
	stop)
		do_stop
		;;
	status) 
		do_status
		;;
	*)
		echo "Usage: $0 {start|stop|status}"
		exit 1
esac

exit $?
