Commit 0ba42fc0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

check-vpn-status: add Cloudflare WARP detection via warp-cli status

parent 42146ceb
......@@ -9,6 +9,7 @@
# OpenConnect — process alive + vpns/tun interface UP
# AmneziaWG/WireGuard — awg0/wg0 interface UP + recent handshake
# Xray — process alive + listening on SOCKS port
# Cloudflare WARP — warp-cli status → Connected
#
# Install: copy to /usr/local/bin/check-vpn-status.sh
# Telegraf config (add to existing telegraf.conf):
......@@ -103,6 +104,16 @@ if pgrep -x xray >/dev/null 2>&1; then
exit 0
fi
# --- Cloudflare WARP ---
if pgrep -x warp-svc >/dev/null 2>&1; then
if warp-cli --accept-tos status 2>/dev/null | grep -q 'Status update: Connected'; then
echo 'vpn_status type="warp",connected=1i'
else
echo 'vpn_status type="warp",connected=0i'
fi
exit 0
fi
# --- GRE ---
if ip link show gre1 >/dev/null 2>&1; then
# GRE is stateless — link UP is the only reliable indicator
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment