#!/bin/sh

case "$1" in
start)
	[ -f __PREFIX__/etc/box/bbstored.conf ] \
		&& [ -f __PREFIX__/etc/box/raidfile.conf ] \
		&& __PREFIX__/bin/bbstored
	[ -f __PREFIX__/etc/box/bbackupd.conf ] \
		&& __PREFIX__/bin/bbackupd
	;;
stop)
	/usr/bin/killall -SIGUSR1 bbackupd
	/usr/bin/killall -SIGUSR1 bbstored
	;;
restart)
	$0 stop
	$0 start
	;;
*)
	echo "Usage: `basename $0` {start|stop|restart}" >&2
	;;
esac

exit 0

