#!/bin/sh

# Startup script for the iServer

# Source function library.
. /etc/rc.d/init.d/functions

case "$1" in
  start)
  	echo -n "Starting server: "
  	daemon /iws/bin/linux/iws /iws >>/var/log/iws.log 2>>/var/log/iws.log &
	echo
	;;
  stop)
  	echo -n "Shutting down server: "
  	/iws/bin/linux/stop_iws localhost:8080 admin admin
	echo
	;;
  restart)
  	echo -n "Restarting server: "
  	/iws/bin/linux/restart_iws localhost:8080 admin admin
	echo
	;;
  *)
  echo "Usage: $0 {start|stop|restart}"
	exit 1
esac

exit 0
