agent-backend/script/cmstart.sh
2022-05-05 13:39:17 +08:00

27 lines
1000 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
if [ ! -d "log/" ]; then
mkdir "log"
fi
bash ./cmstop.sh
time=$(date "+%Y_%m_%d_%H:%M:%S")
if [ -f "./log/cm.log" ]; then
echo "move log ./log/cm_${time}.log"
mv ./log/cm.log "./log/cm_${time}.log"
fi
if [ -f "./log/cm.err" ]; then
mv ./log/cm.err "./log/cm_${time}.err"
fi
# ps -ef | grep java | grep bdserver | grep CM | awk '{print $2}' | xargs kill -9
java -Dfile.encoding=UTF-8 -Djava.library.path="./dynamicLibrary" -Dlog4j.configurationFile=./log4j2.properties -cp "./libs/*:bdagent.jar" org.bdware.server.CMHttpServer 1>/dev/null 2>/dev/null &
#-Xmx3550m -Xms3550m -Xmn2g
#-XX:+UseConcMarkSweepGC -XX:CMSFullGCsBeforeCompaction=5
# 以下可启用https/wss其中./ssl/xxx.pfx为ssl证书的路径:后面的123456是密码。
# java -Dfile.encoding=UTF-8 -cp "./libs/*:bdagent.jar" org.bdware.server.CMHttpServer -service-port=8080 -enable-ssl=./ssl/xxx.pfx:123456 -do-repo-ip=127.0.0.1 -do-repo-port=18099 1 > ./log/cm.log 2> ./log/cm.err &
echo $! >./PID