Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(scripts): use absolute main.py path and simplify stop matching to avoid stale PID false-positives

cyhhaof25986026252
diff --git a/start.sh b/start.sh
index aa847f924..81af621fd 100755
--- a/start.sh
+++ b/start.sh
@@ -5,6 +5,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
LOG_DIR="$SCRIPT_DIR/logs"
LOG_FILE="$LOG_DIR/bot_$(date +%Y%m%d_%H%M%S).log"
PID_FILE="$SCRIPT_DIR/.bot.pid"
+MAIN_PATH="$SCRIPT_DIR/main.py"
# Create logs directory if it doesn't exist
mkdir -p "$LOG_DIR"
@@ -96,7 +97,7 @@ echo "Bot started at: $(date)" >> "$LOG_FILE"
echo "============================================" >> "$LOG_FILE"
# Run python in unbuffered mode for real-time logging
-nohup python3 -u main.py >> "$LOG_FILE" 2>&1 &
+nohup python3 -u "$MAIN_PATH" >> "$LOG_FILE" 2>&1 &
# Save new PID
NEW_PID=$!
diff --git a/stop.sh b/stop.sh
index c0334ed67..282448793 100755
--- a/stop.sh
+++ b/stop.sh
@@ -3,6 +3,7 @@
# Get the absolute path of current directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PID_FILE="$SCRIPT_DIR/.bot.pid"
+MAIN_PATH="$SCRIPT_DIR/main.py"
echo "Stopping Claude Proxy..."
@@ -11,11 +12,9 @@ if [ -f "$PID_FILE" ]; then
# Check if the process exists
if ps -p "$PID" > /dev/null 2>&1; then
- # Verify it's actually our python process in the correct directory
+ # Verify it's our python process by absolute main.py path
PROCESS_CMD=$(ps -p "$PID" -o command= 2>/dev/null || echo "")
- PROCESS_CWD=$(lsof -p "$PID" -a -d cwd -Fn 2>/dev/null | grep '^n' | cut -c2- || echo "")
-
- if [[ "$PROCESS_CMD" == *"python"*"main.py"* ]] && [[ "$PROCESS_CWD" == "$SCRIPT_DIR" ]]; then
+ if [[ "$PROCESS_CMD" == *"$MAIN_PATH"* ]]; then
echo "Found bot process (PID: $PID), stopping..."
kill -TERM "$PID" 2>/dev/null