#!/bin/sh
# $Id: trafshow.init,v 1.2 2001/09/28 19:29:55 kad Exp $
#
# chkconfig: - 88 06
# description: This script opens trafshow window on /dev/tty11
# processname: trafshow
# config: /etc/sysconfig/trafshow

# source function library
. /etc/rc.d/init.d/functions

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

# The process must be configured first.
[ -x /usr/bin/trafshow ] || exit 0

if [ -f /etc/sysconfig/trafshow ];then
        . /etc/sysconfig/trafshow
fi

[ -z "$TERMINAL" ] && TERMINAL="11"
	
RETVAL=0

prog="trafshow"

case "$1" in
  start)
        action $"Starting $prog: " open -c $TERMINAL -- trafshow $OPTIONS
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/trafshow
	;;
  stop)
	echo -n $"Shutting down $prog: "
	killproc trafshow
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/trafshow
	echo
	;;
  restart|reload)
        $0 stop
        $0 start
	RETVAL=$?
        ;;
  condrestart)
        if [ -f /var/lock/subsys/trafshow ]; then
                $0 stop
		$0 start
        fi
	RETVAL=$?
        ;;
  status)
        status trafshow
	RETVAL=$?
        ;;
  *)
	echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
	exit 1
esac

exit $RETVAL
