#!/bin/sh
PROG="Router Advertisement Daemon"
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
NOSELFM="/etc/no-selfmonitor/radvd"

# Load include files
. /etc/rc.status

# Reset status of this service
rc_reset

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