#!/bin/sh
PROG="IPv6 TSPC Tunnel Broker"
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
NOSELFM="/etc/no-selfmonitor/ipv6-tspc"

# Load include files
. /etc/rc.status

# Reset status of this service
rc_reset

case "$1" in
    start)
        echo -n "Starting $PROG "
        /usr/local/bin/ipv6-tspc -f /usr/local/etc/ipv6-tspc.cfg &
        rc_status -v
        rm -f $NOSELFM
        ;;
    stop)
        echo -n "Shutting down $PROG "
        touch $NOSELFM
        killproc ipv6-tspc
        rc_status -v
        ;;
    restart)
        $0 stop
        sleep 1
        $0 start
        rc_status
        ;;
    status)
        echo -n "Checking for service $PROG "
        checkproc ipv6-tspc
        rc_status -v
        ;;
   *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 1
        ;;
esac
rc_exit
