#!/bin/sh
#
# TabulatorControl - Tabulator Server delegating init script
#

TABULATORSERVER=#TABULATORSERVER#
USERID=#USERID#

case `basename $0` in
	S*)	cmd=start	;;
	K*)	cmd=stop	;;
	*)	cmd=$1		;;
esac

su $USERID -c "$TABULATORSERVER/bin/TabulatorControl.sh $cmd"

# On Linux we must create a "lockfile" when we "start",
# otherwise we'll not get asked to "stop" later.

if [ `uname -s` = Linux ] ; then
	lockfile=/var/lock/subsys/tabulatorserver
	case $cmd in
		start)	touch $lockfile ;;
		stop)	rm $lockfile 2> /dev/null ;;
	esac
fi

exit 0
