From 5c242b6c37b34c2106af6accef4670156655df19 Mon Sep 17 00:00:00 2001 From: "idiotalex@163.com" Date: Mon, 19 Apr 2021 16:55:52 +0800 Subject: [PATCH] update Server.sh and jpom-service.sh for auto start --- docs/jpom-service.sh | 4 +- modules/server/script/Server.sh | 77 +-------------------------------- 2 files changed, 5 insertions(+), 76 deletions(-) diff --git a/docs/jpom-service.sh b/docs/jpom-service.sh index 26b230bb7..35d20b330 100644 --- a/docs/jpom-service.sh +++ b/docs/jpom-service.sh @@ -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 diff --git a/modules/server/script/Server.sh b/modules/server/script/Server.sh index dc2a52e5e..0a0aae049 100644 --- a/modules/server/script/Server.sh +++ b/modules/server/script/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.