#!/bin/bash
#
# 4dlive This shell script takes care of starting and stopping 4dlive.
#
# chkconfig: 2345 55 25
# description: 4dlive is the 4DLIVE daemon.

### BEGIN INIT INFO
# Provides:			4dlive
# Required-Start:	$remote_fs $syslog
# Required-Stop:	$remote_fs $syslog
# Default-Start:	2 3 4 5
# Default-Stop:		0 1 6
# Short-Description: start and stop 4dlive
# Description: This service starts up the 4DLIVE daemon.
### END INIT INFO


PROC_HOME=/4DLIVE_DATA/bin
export PROC_HOME

PATH=$PATH:/4DLIVE_DATA/cmd:/4DLIVE_DATA/script

prog=4dlive

source /root/.bashrc
echo "4dlive service start."

start() {
        echo -n $"Starting $prog: "
		sh /4DLIVE_DATA/script/pm_startup.sh
  		echo "4dlive service start."
}

stop() {
        echo -n $"Shutting down $prog: "
		sh /4DLIVE_DATA/script/pm_shutdown.sh
  		echo "4dlive service stop."
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart)
	stop
	start
	;;
  *)
	echo $"Usage: $0 {start|stop|restart}"
	exit 2
esac
