#!/bin/bash

### BEGIN INIT INFO
# Provides:          xWebX
# Required-Start:    $local_fs $remote_fs $network $syslog $named
# Required-Stop:     $local_fs $remote_fs $network $syslog $named
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: start/stop xWebX server
### END INIT INFO

set -e

UBOXDIR=/opt/apps/com.utel.uboxweb/files
export UBOXDIR=${UBOXDIR}

. /lib/lsb/init-functions

start()
{
	echo -n $"start ubox web server"
	cd ${UBOXDIR}
	./start.sh
	echo
}

stop()
{
	echo -n $"stop ubox web server"
	cd ${UBOXDIR}
	./stop.sh
	echo
}


case "$1" in
	start)
		start
		;;
	stop)
		stop
		;;
	restart|reload)
		stop
		start
		;;
	*)
		echo $"Usage: $0 {start|stop|restart|reload}"
		;;
esac

