#!/bin/bash
#
# rc.sagator: alternate startup script for Slackware
#
# Version:      1.0    Wed Dec 01 00:47:24 ETC+1 2004
#
# Author:       Daniele Dignani <daniele@dignani.it>
#

SAGATOR=/usr/sbin/sagator
FLAG=/var/lock/subsys/sagator
PIDFILE=/var/run/sagator.pid

# See how we were called.
case "$1" in
  start)
	echo -n "Starting Sagator: "
	$SAGATOR
	if [ $? -eq 0 ]; then 
	    touch $FLAG
	    echo $SAGATOR
	fi
	;;
  stop)
	if [ -f $FLAG ]; then
	    echo "Stopping Sagator: "
	    rm -f $FLAG
	    kill `cat $PIDFILE`
	else
	    echo "Sagator is not running"
	fi	
	rm -f $PIDFILE
	;;
  *)
	echo "Usage: $0 {start|stop}"
esac
