#!/bin/sh

SERVER=/usr/sbin/cannaserver
KILLER=/usr/sbin/cannakill
LOCKD=/var/lock/subsys

[ -f $SERVER ] || exit 0
case "$1" in
start)
  echo -n "Starting Canna server: "
  rm -f /tmp/.iroha_unix/IROHA
  $SERVER -inet
  echo
  [ -d $LOCKD ] && touch $LOCKD/canna
  ;;
stop)
  echo -n "Shutting down Canna server: "
  $KILLER
  echo
  [ -d $LOCKD ] && rm -f $LOCKD/canna
  ;;
install)
  echo canna network
  ;;
*)
  echo "Usage: canna {start|stop}"
  exit 1
  ;;
esac
exit 0
