代码拉取完成,页面将自动刷新
同步操作将从 openGauss/openGauss-workbench 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
APP_NAME="datakit"
JAR_PATTERN="openGauss-datakit-*.jar"
PID_FILE="datakit.pid"
refresh_pid() {
JAR_FILE=$(ls $JAR_PATTERN 2>/dev/null | tail -n 1)
if [ -z "$JAR_FILE" ]; then
echo "No matching JAR file found."
exit 1
fi
SEVER_PATH=$(pwd)
PID=$(ps -f --sort=start | grep "$JAR_FILE" | grep java | awk '{print $2}' | xargs -I{} pwdx {} | grep "$SEVER_PATH" | awk '{print $1}' | sed 's/.$//' | tail -n 1)
if [ -n "$PID" ]; then
echo $PID > $PID_FILE
fi
}
start_up() {
nohup java -Xms2048m -Xmx4096m -jar $JAR_FILE --spring.profiles.active=temp > logs/visualtool-main.out 2>&1 &
echo $! > $PID_FILE
echo "Datakit started."
}
start() {
refresh_pid
if [ -e $PID_FILE ]; then
PID=$(cat $PID_FILE)
if ps -p $PID > /dev/null; then
echo "Datakit is already running with PID: $PID"
exit 1
else
echo "Stale PID file. Cleaning up."
rm $PID_FILE
fi
fi
start_up
}
stop() {
refresh_pid
if [ -e $PID_FILE ]; then
PID=$(cat $PID_FILE)
kill $PID
rm $PID_FILE
echo "Datakit stopped."
else
echo "Datakit is not running."
fi
}
restart() {
stop
start_up
}
status() {
refresh_pid
if [ -e $PID_FILE ]; then
PID=$(cat $PID_FILE)
if ps -p $PID > /dev/null; then
echo "Datakit is running with PID: $PID"
else
echo "Stale PID file. Datakit may not be running."
rm $PID_FILE
fi
else
echo "Datakit is not running."
fi
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit 0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。