Add fail-closed WireGuard container gateway

This commit is contained in:
Mikei386
2026-08-22 20:48:49 +02:00
parent 2f3bdde8b0
commit 0e5876f1a9
17 changed files with 365 additions and 109 deletions
@@ -0,0 +1,9 @@
#!/bin/sh
set -eu
wg show wg0 >/dev/null
ip link show wg0 | grep -q 'state UNKNOWN\|state UP'
latest=$(wg show wg0 latest-handshakes | cut -f2 | head -n 1)
now=$(date +%s)
[ "${latest:-0}" -gt 0 ]
[ $((now - latest)) -lt 180 ]
kill -0 1