save code
This commit is contained in:
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
PID_FILE=proxy.pid
|
||||
LOG_FILE=proxy.log
|
||||
|
||||
if [ -f "$PID_FILE" ] && kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
|
||||
echo "already running (pid $(cat "$PID_FILE"))"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nohup python3 proxy.py >> "$LOG_FILE" 2>&1 &
|
||||
echo $! > "$PID_FILE"
|
||||
echo "started (pid $!) → log: $LOG_FILE"
|
||||
Reference in New Issue
Block a user