#!/bin/bash pkill -f "python ah.py.*wan22" 2>/dev/null # fallback: kill by port PID=$(ss -tlnp | grep 8079 | grep -oP 'pid=\K\d+') [ -n "$PID" ] && kill $PID echo "wan22-service stopped"