#!/bin/sh
#
# $NetBSD: usbd,v 1.12 2012/05/16 05:06:49 keesj Exp $
#
# PROVIDE: usdb
# REQUIRE: DEVMAN

if [ -f /etc/rc.subr ]
then
	. /etc/rc.subr
fi

service_name="usbd"
service_binary="/usr/pkg/sbin/${service_name}"

if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -f /etc/rc.d/DAEMON ]
then
	load_rc_config $service_name
	run_rc_command "$1"
else
	case ${1:-start} in
	start)
		if [ -x ${service_binary} ]
		then
			/bin/echo "Starting ${service_name}."
			/bin/service up "${service_binary}"
		fi
		;;
	stop)
		service down "${service_name}"
		;;
	restart)
		service refresh "${service_name}"
		;;
	status)
		echo "status not implemented for service ${service_name}"
		;;
	esac
fi
