update jpom-service.sh

This commit is contained in:
idiotalex@163.com 2021-04-19 16:47:54 +08:00
parent cf2a936d55
commit 7af6db550d

View File

@ -1,4 +1,9 @@
#!/bin/bash #!/bin/bash
ROOT_PATH="$1"
FILE_NAME="$2"
echo '#!/bin/bash
# chkconfig: 356 10 90 # chkconfig: 356 10 90
# description: Jpom-Server service # description: Jpom-Server service
# processname: jpom-server # processname: jpom-server
@ -21,36 +26,34 @@
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR # 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 # 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 # 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. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.' > $FILE_NAME
# make sure sh could load enviroment variables, in particular, in the init.d directory echo '# make sure sh could load enviroment variables, in particular, in the init.d directory
source /etc/profile source /etc/profile' >> $FILE_NAME
ROOT_PATH="$1" echo "# 启动程序
# 启动程序
function start() { function start() {
$ROOT_PATH/Server.sh start $ROOT_PATH/Server.sh start
} }" >> $FILE_NAME
# 停止程序 echo "# 停止程序
function stop() { function stop() {
$ROOT_PATH/Server.sh stop $ROOT_PATH/Server.sh stop
status status
} }" >> $FILE_NAME
# 获取程序状态 echo "# 获取程序状态
function status() { function status() {
$ROOT_PATH/Server.sh status $ROOT_PATH/Server.sh status
} }" >> $FILE_NAME
# 提示使用语法 echo '# 提示使用语法
function usage() { function usage() {
echo "Usage: $0 {start|stop|restart|status|create}" echo "Usage: $0 {start|stop|restart|status|create}"
RETVAL="2" RETVAL="2"
} }' >> $FILE_NAME
# See how we were called. echo '# See how we were called.
RETVAL="0" RETVAL="0"
case "$1" in case "$1" in
start) start)
@ -71,4 +74,4 @@ case "$1" in
;; ;;
esac esac
exit $RETVAL exit $RETVAL' >> $FILE_NAME