#!/bin/bash  
#  
# Description:  This shell script takes care of starting and stopping dennis  
#  
# Source function library  

#the service name  for example: dennis  
SNAME=JYNGJCZ2

#the full path and name of the daemon program  
#Warning: The name of executable file must be identical with service name  
PROG=/opt/apps/com.vsecure.chenxinsd/files/$SNAME  


# start function  
start() {  
#check the daemon status first  
	PID=`pidof $SNAME`
	if [ "$PID" = "" ] ; then
		$PROG  
	else
		echo "$SNAME already running"
	fi

}  

#stop function  
stop() {  
	PID=`pidof $SNAME`
	if [ "$PID" = "" ] ; then
		echo "$SNAME not running"
	else
		kill -9 `pidof $SNAME`
	fi
}  

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