base_agent/run.sh

36 lines
808 B
Bash
Executable File
Raw 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.

#!/usr/bin/env bash
if [ -f "./envs" ]; then
source ./envs
fi
# 创建日志目录
if ! [ -d ${LOG_DIR} ]; then
mkdir -p $LOG_DIR
fi
function start_hexstrike_ai() {
if [ -f "$HEXSTRIKE_AI_PID_FILE" ]; then
echo "错误: hexstrike_ai 似乎已在运行 (PID: $(cat $HEXSTRIKE_AI_PID_FILE))"
exit 1
fi
# 启动 Gunicorn
echo "正在启动 hexstrike_ai"
cd skills/hexstrike_ai && gunicorn -w ${HEXSTRIKE_AI_WORKERS} \
-b ${HEXSTRIKE_AI_BIND_ADDRESS} \
--pid ${HEXSTRIKE_AI_PID_FILE} \
--access-logfile "$LOG_DIR/access.log" \
--error-logfile "$LOG_DIR/error.log" \
-D \
${HEXSTRIKE_AI_ENTRY}
if [ $? -eq 0 ]; then
echo "启动成功PID: $(cat $PID_FILE)"
else
echo "启动失败,请检查日志。"
fi
}
start_hexstrike_ai