#!/bin/sh

. /etc/rc.conf

case "$1" in
autostart)
	test x"${smcroute:-NO}" = x"NO" && exit 0
	exec $0 start
	;;
start)
	[ -d /var/lib ] || mkdir /var/lib
	smcroute -d
	;;
stop)
	killall smcroute
	;;
restart)
	$0 stop
	sleep 3
	$0 start
	;;
*)
	echo "Usage: $0 {start | stop | restart}"
	exit 1
	;;
esac
exit $?
