代码拉取完成,页面将自动刷新
同步操作将从 WeBank/WeBASE-Node-Manager 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
APP_MAIN=com.webank.webase.node.mgr.Application
CLASSPATH='conf/:apps/*:lib/*'
CURRENT_DIR=$(pwd)/
LOG_DIR=${CURRENT_DIR}log
CONF_DIR=${CURRENT_DIR}conf
ARIAL_DIR=${CONF_DIR}/Arial
SERVER_PORT=$(cat $CONF_DIR/application.yml | grep "server:" -A 3 | grep "port" | awk '{print $2}'| sed 's/\r//')
if [ ${SERVER_PORT}"" = "" ];then
echo "$CONF_DIR/application.yml server port has not been configured"
exit -1
fi
if [ ${JAVA_HOME}"" = "" ];then
echo "JAVA_HOME has not been configured"
exit -1
fi
copyArial(){
arialFolder="/usr/share/fonts/arial"
if [ ! -d "$arialFolder" ]; then
sudo mkdir -p "$arialFolder" && sudo cp $ARIAL_DIR/arial*.ttf $arialFolder/
fi
}
mkdir -p log
startWaitTime=30
processPid=0
processStatus=0
checkProcess(){
server_pid=$(ps aux | grep java | grep $CURRENT_DIR | grep $APP_MAIN | awk '{print $2}')
if [ -n "$server_pid" ]; then
processPid=$server_pid
processStatus=1
else
processPid=0
processStatus=0
fi
}
JAVA_OPTS=" -Dfile.encoding=UTF-8"
JAVA_OPTS+=" -Djava.security.egd=file:/dev/./urandom"
JAVA_OPTS+=" -Xmx256m -Xms256m -Xmn128m -Xss512k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m"
JAVA_OPTS+=" -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${LOG_DIR}/heap_error.log"
start(){
copyArial
checkProcess
echo "==============================================================================================="
if [ $processStatus == 1 ]; then
echo "Server $APP_MAIN Port $SERVER_PORT is running PID($processPid)"
echo "==============================================================================================="
else
echo -n "Server $APP_MAIN Port $SERVER_PORT ..."
nohup $JAVA_HOME/bin/java -Djdk.tls.namedGroups="secp256k1" $JAVA_OPTS -cp $CLASSPATH $APP_MAIN >> $LOG_DIR/node-manager.out 2>&1 &
count=1
result=0
while [ $count -lt $startWaitTime ] ; do
checkProcess
if [ $processPid -ne 0 ]; then
result=1
break
fi
let count++
echo -n "."
sleep 1
done
if [ $result -ne 0 ]; then
echo "PID($processPid) [Starting]. Please message check through the log file (default path:./log/)."
echo "==============================================================================================="
else
echo "[Failed]. Please check message through the log file (default path:./log/)."
echo "==============================================================================================="
fi
fi
}
start
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。