fff-wireguard: Add nodewatcher Script

With this script the monitoring have the correct information that the router is
connectet with wireguard or not.

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
This commit is contained in:
Christian Dresel 2021-01-29 09:09:10 +01:00
parent 83b70b8332
commit 60df31282c
1 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,8 @@
#!/bin/sh
# Netmon Nodewatcher (C) 2010-2012 Freifunk Oldenburg
# License; GPL v3
# Checks if wireguard has peers
vpn_active=0
wg | grep hands >/dev/null && vpn_active=1
SYSTEM_DATA="$SYSTEM_DATA<vpn_active>$vpn_active</vpn_active>"