forked from 1rgs/claude-code-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestart.sh
More file actions
27 lines (22 loc) · 760 Bytes
/
restart.sh
File metadata and controls
27 lines (22 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# anthropic-proxy Restart Script for Linux/macOS/Bash
set -e
echo "🔍 Finding and stopping existing anthropic-proxy processes on port 8082..."
# Find PID using port 8082 (handles multiple OS variants)
if command -v lsof >/dev/null 2>&1; then
PID=$(lsof -t -i:8082)
elif command -v fuser >/dev/null 2>&1; then
PID=$(fuser 8082/tcp 2>/dev/null)
else
# Fallback to netstat/awk if others aren't available
PID=$(netstat -anop | grep :8082 | grep LISTEN | awk '{print $7}' | cut -d/ -f1)
fi
if [ -n "$PID" ]; then
echo "🛑 Stopping process (PID: $PID)..."
kill -9 $PID
echo "✅ Existing process stopped."
else
echo "ℹ️ No existing process found on port 8082."
fi
# Start the server using start.sh
./start.sh