mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-11-30 02:48:17 +08:00
update Server.sh and jpom-service.sh for auto start
This commit is contained in:
parent
7af6db550d
commit
5c242b6c37
@ -49,7 +49,7 @@ function status() {
|
||||
|
||||
echo '# 提示使用语法
|
||||
function usage() {
|
||||
echo "Usage: $0 {start|stop|restart|status|create}"
|
||||
echo "Usage: $0 {start|stop|restart|status}"
|
||||
RETVAL="2"
|
||||
}' >> $FILE_NAME
|
||||
|
||||
@ -75,3 +75,5 @@ case "$1" in
|
||||
esac
|
||||
|
||||
exit $RETVAL' >> $FILE_NAME
|
||||
|
||||
rm -f jpom-server.sh
|
||||
|
@ -161,81 +161,8 @@ function usage()
|
||||
|
||||
# 创建自启动服务文件
|
||||
function create() {
|
||||
echo '#!/bin/bash
|
||||
# chkconfig: 356 10 90
|
||||
# description: Jpom-Server service
|
||||
# processname: jpom-server
|
||||
# The MIT License (MIT)
|
||||
#
|
||||
# Copyright (c) 2019 码之科技工作室
|
||||
#
|
||||
# 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
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' > jpomserverd
|
||||
|
||||
echo '# make sure sh could load enviroment variables, in particular, in the init.d directory
|
||||
source /etc/profile' >> jpomserverd
|
||||
|
||||
echo "ROOT_PATH=${Path}" >> jpomserverd
|
||||
|
||||
echo '# 启动程序
|
||||
function start() {
|
||||
$ROOT_PATH/Server.sh start
|
||||
}' >> jpomserverd
|
||||
|
||||
echo '# 停止程序
|
||||
function stop() {
|
||||
$ROOT_PATH/Server.sh stop
|
||||
status
|
||||
}' >> jpomserverd
|
||||
|
||||
echo '# 获取程序状态
|
||||
function status() {
|
||||
$ROOT_PATH/Server.sh status
|
||||
}' >> jpomserverd
|
||||
|
||||
echo '# 提示使用语法
|
||||
function usage() {
|
||||
echo "Usage: $0 {start|stop|restart|status|create}"
|
||||
RETVAL="2"
|
||||
}' >> jpomserverd
|
||||
|
||||
echo '# See how we were called.
|
||||
RETVAL="0"
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
status)
|
||||
status
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
exit $RETVAL' >> jpomserverd
|
||||
echo 'create jpomservered file done'
|
||||
yum install -y wget && wget -O jpm-server.sh https://dromara.gitee.io/jpom/docs/jpom-server.sh && bash jpm-server.sh "$Path" jpom-server-service
|
||||
echo 'create jpom-server-service file done'
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
|
Loading…
Reference in New Issue
Block a user