Linux教程

linux脚本启动jar

本文主要是介绍linux脚本启动jar,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

启动

 

#!/bin/bash
#iam_address=172.30.162.45:8002

nohup ${HCS_OW_HOME}/jre/bin/java -jar ${HCS_OW_HOME}/service/hcs-online-ow-service.jar \
--server.port=8012 \
--spring.datasource.driver-class-name=com.huawei.gauss.jdbc.inner.GaussDriver \
--spring.datasource.username=moprivatecloudservicedb \
--spring.datasource.password=Changeme_123 \
--spring.datasource.url=jdbc:zenith:@127.0.0.1:6001 \
--spring.redis.database=2 \
--spring.redis.host=127.0.0.1 \
--spring.redis.port=6379 \
--spring.redis.password=huawei@1234 \
--spring.redis.jedis.pool.max-active=200 \
--spring.redis.jedis.pool.max-wait=-1 \
--spring.redis.jedis.pool.max-idle=10 \
--spring.redis.jedis.pool.min-idle=5 \
--spring.redis.timeout=1000 \
--vdc_admin=vdc_admin \
--vdc_admin_pwd=Huawei@123 \
--bss_admin=liyajun \
--bss_admin_pwd=huawei12#$ \
--iam_address=172.30.162.45:8003 \
--ldapid=65d5a253-35f8-48a6-82cf-0186cbe366ca \
--tmp_path=/opt/hcsow/static-resource/tmp \
--upload_path=/opt/hcsow/static-resource \
--default_font=方正兰亭黑简体 \
--fonts=宋体,微软雅黑,黑体,仿宋,方正兰亭黑简体,Calibri,Arial \
--convert_url=http://10.29.200.251:8888/convert \
--server_host=https://127.0.0.1:8012 \
>/dev/null &

echo hcs-online-ow-service is started

 

停止

#!/bin/bash

PID=$(ps -ef | grep ${HCS_OW_HOME}/service/hcs-online-ow-service.jar | grep -v grep | awk '{ print $2 }')
if [ -z "$PID" ]; then
  echo hcs-online-ow-service is already stopped
else
  kill -9 $PID
  echo hcs-online-ow-service is stopped
fi

 

总脚本

#!/bin/bash

source ${HCS_OW_HOME}/bin/portal-service-stop.sh

source ${HCS_OW_HOME}/bin/portal-service-start.sh

 

这篇关于linux脚本启动jar的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!