#!/bin/bash
#chkconfig: 2345 80 93
#description: ninghai
source /etc/profile
case "$1" in
start)
cd /data/program/projects/yuantong
sh start.sh
!
echo "yuantong startup"
;;
stop)
es_pid=`ps aux|grep yuantong-search-0.0.1-SNAPSHOT.jar | grep -v 'grep yuantong-search-0.0.1-SNAPSHOT.jar' | awk '{print $2}'`
kill $es_pid
echo "yuantong stopped"
;;
restart)
es_pid=`ps aux|grep yuantong-search-0.0.1-SNAPSHOT.jar | grep -v 'grep yuantong-search-0.0.1-SNAPSHOT.jar' | awk '{print $2}'`
kill -9 $es_pid
echo "yuantong stopped"
cd /data/program/projects/yuantong
sh start.sh
!
echo "yuantong restart"
;;
*)
echo "start|stop|restart"
;;
esac
exit $?
转载请注明:扩产网 » 启动脚本