Add fail-closed WireGuard container gateway
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user