#!/bin/sh
# chkconfig: 2345 10 90
# description: xxx

APP_ID=xxx
LOG_NAME=xxx.log
INMS_HOME=/dav3/java

do_start() {
cd  $INMS_HOME
nohup /usr/local/java/bin/java -Dspring.profiles.active=dev -jar ${INMS_HOME}/${APP_ID}.jar --server.port=8090 >> ${LOG_NAME} &
}

do_stop() {
kill -9 `ps -ef |grep -i ${APP_ID}.jar |grep -v grep |awk -F" " '{print $2}'`
}

case "$1" in
    start)
        do_start
        echo "."
        ;;
    stop)
        do_stop
        echo "."
        ;;
    *)
        echo "Please use start or stop as first argument"
        ;;
esac