Jpom/docs/jpom-service.sh

85 lines
2.0 KiB
Bash
Raw Normal View History

2021-04-19 16:24:05 +08:00
#!/bin/bash
# chkconfig: 356 10 90
# description: Jpom-Server service
# processname: jpom-server
# The MIT License (MIT)
#
2021-12-14 21:35:35 +08:00
# Copyright (c) 2019 Code Technology Studio
2021-04-19 16:24:05 +08:00
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2021-12-14 21:35:35 +08:00
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2021-04-19 16:24:05 +08:00
2021-07-31 23:55:14 +08:00
# loading env
if [ -f /etc/profile ]; then
. /etc/profile
fi
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
if [ -f ~/.bash_profile ]; then
. ~/.bash_profile
fi
2021-04-19 16:24:05 +08:00
2021-04-19 20:33:30 +08:00
RUN_PATH="JPOM_RUN_PATH"
2021-04-19 19:59:44 +08:00
# 启动程序
2021-04-19 16:24:05 +08:00
function start() {
2021-04-19 20:41:35 +08:00
sh ${RUN_PATH} start
2021-04-19 19:59:44 +08:00
}
2021-04-19 16:24:05 +08:00
2021-04-19 19:59:44 +08:00
# 停止程序
2021-04-19 16:24:05 +08:00
function stop() {
2021-04-19 20:41:35 +08:00
sh ${RUN_PATH} stop
2021-04-19 19:59:44 +08:00
}
2021-04-19 16:24:05 +08:00
2021-04-19 19:59:44 +08:00
# 获取程序状态
2021-04-19 16:24:05 +08:00
function status() {
2021-04-19 20:41:35 +08:00
sh ${RUN_PATH} status
2021-04-19 19:59:44 +08:00
}
2021-04-19 16:24:05 +08:00
2021-04-19 19:59:44 +08:00
# 提示使用语法
2021-04-19 16:24:05 +08:00
function usage() {
echo "Usage: $0 {start|stop|restart|status}"
2021-04-19 16:24:05 +08:00
RETVAL="2"
2021-04-19 19:59:44 +08:00
}
2021-04-19 16:24:05 +08:00
2021-04-19 19:59:44 +08:00
# See how we were called.
2021-04-19 16:24:05 +08:00
RETVAL="0"
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
usage
;;
esac
2021-04-19 19:59:44 +08:00
exit $RETVAL