#!/bin/sh

# Simple init script for starting
# the gateway service at boot time.
#
# Either add a call to it in /etc/rc.d/rc.local,
# or copy it to /etc/rc.d/init.d and symlink it
# to your runlevel.
#
# Edit the following line if you installed the
# nocat software somewhere else.
#
NC=/usr/local/nocat

export PERL5LIB=$NC/lib:$PERL5LIB
export NOCAT=$NC/nocat.conf

case "$1" in
  start)
        echo "Starting the NoCat gateway..."
	$NC/bin/gateway
        ;;
  stop)
	echo "Stopping the NoCat gateway..."
	killall gateway
        ;;
  restart)
        $0 stop
	sleep 1
        $0 start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac

#
# Ende
#
