mirror of
https://github.com/Qortal/names.git
synced 2025-06-14 18:21:21 +00:00
21 lines
403 B
Bash
Executable File
21 lines
403 B
Bash
Executable File
#!/bin/bash
|
|
|
|
PID_FILE=".qapp-tunnel.pid"
|
|
|
|
if [ ! -f "$PID_FILE" ]; then
|
|
echo "Tunnel PID file not found."
|
|
exit 1
|
|
fi
|
|
|
|
TUNNEL_PID=$(cat "$PID_FILE")
|
|
|
|
if ps -p $TUNNEL_PID > /dev/null; then
|
|
echo "Stopping SSH tunnel with PID $TUNNEL_PID..."
|
|
kill $TUNNEL_PID
|
|
rm "$PID_FILE"
|
|
echo "Tunnel stopped."
|
|
else
|
|
echo "No active tunnel with PID $TUNNEL_PID. Removing stale PID file."
|
|
rm "$PID_FILE"
|
|
fi
|