1 2 3
#!/usr/bin/env zsh set -euo pipefail ssh -O exit sanctum-tunnel 2>/dev/null && echo "Tunnel stopped" || echo "No tunnel running"