#!/bin/sh
#description: ngse_sm_server
tpid=`ps aux | grep -c 'ngse_sm.jar'`
case "$1" in
start)
if [ $tpid -le 1 ]; then
echo "NGSE_SM service start..."
sudo "$JAVA_HOME"/bin/java -Xms1024m -Xmx2048m -jar $NGSE_SM/ngse_sm.jar >> $NGSE_SM/log/server.log 2>&1 &
echo $! > $NGSE_SM/server.pid
else
echo "NGSE_SM service already started.PID: `cat $NGSE_SM/server.pid`"
exit 0
fi
;;
stop)
echo "NGSE_SM service stop..."
sudo kill -9 `cat $NGSE_SM/server.pid`
rm -rf $NGSE_SM/server.pid
;;
restart)
echo "NGSE_SM service restart..."
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: ngse_sm_server.sh(start|stop|restart)"
esac
exit 0
#description: ngse_sm_server
tpid=`ps aux | grep -c 'ngse_sm.jar'`
case "$1" in
start)
if [ $tpid -le 1 ]; then
echo "NGSE_SM service start..."
sudo "$JAVA_HOME"/bin/java -Xms1024m -Xmx2048m -jar $NGSE_SM/ngse_sm.jar >> $NGSE_SM/log/server.log 2>&1 &
echo $! > $NGSE_SM/server.pid
else
echo "NGSE_SM service already started.PID: `cat $NGSE_SM/server.pid`"
exit 0
fi
;;
stop)
echo "NGSE_SM service stop..."
sudo kill -9 `cat $NGSE_SM/server.pid`
rm -rf $NGSE_SM/server.pid
;;
restart)
echo "NGSE_SM service restart..."
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: ngse_sm_server.sh(start|stop|restart)"
esac
exit 0