diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..b35a130 --- /dev/null +++ b/start.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# param-hub 启动脚本(setsid 完全脱离终端,确保持久运行) +APP_DIR="$(cd "$(dirname "$0")" && pwd)" +PID_FILE="$APP_DIR/app.pid" +PYTHON="/home/hz1/miniconda3/envs/openclaw/bin/python3" +cd "$APP_DIR" +if [ -f "$PID_FILE" ]; then + PID=$(cat "$PID_FILE") + if ps -p $PID > /dev/null 2>&1; then + echo "param-hub 已在运行 (PID: $PID)" + exit 0 + fi +fi +setsid nohup "$PYTHON" app.py > logs/app.log 2>&1 & +echo $! > "$PID_FILE" +sleep 2 +echo "param-hub 已启动 (PID: $(cat $PID_FILE))"