#!/bin/bash
### BEGIN INIT INFO
# Provides:          IPinsided-LWS
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remore_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Interezen IPinsided-LWS
# Description:       Interezen IPinside-lws server
### END INIT INFO

# set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:.

. /lib/lsb/init-functions

case "$1" in
  start)
    cd /opt/interezen/ipinside/ && LWSDaemon > /dev/null 2> /dev/null &
    ;;
  stop)
    pkill -TERM LWSDaemon || true
    ;;
  restart|force-reload)
    $0 stop
    $0 start
    ;;
  status)
    status_of_proc "LWSDaemon" && exit 0 || exit $?
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
    exit 1
    ;;
esac

exit 0
