#! /bin/sh -e

test -x /usr/bin/cloud_client || exit 0

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

exit 0
