#! /bin/sh -e

test -x /usr/bin/cloud_brd || exit 0
OPTS="-c /etc/config.cfg"

case "$1" in
  start)
    echo -n "Starting cloud_brd daemon: "
    start-stop-daemon -S -b -a /usr/bin/cloud_brd -- $OPTS
    echo "start cloud_brd."
    ;;
  stop)
    echo -n "Stopping cloud_brd daemon: "
    start-stop-daemon -K -n cloud_brd
    echo "stop cloud_brd."
    ;;
  restart|force-reload)
    $0 stop
    $0 start
    ;;
  *)
    echo "Usage: /etc/init.d/start_cloud_brd {start|stop|restart|force-reload}"
    exit 1
esac

exit 0
