Compare commits

...

2 Commits

Author SHA1 Message Date
Christian Dresel 60df31282c 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>
2021-01-29 09:09:10 +01:00
Christian Dresel 83b70b8332 treewide: Move fastd information for nodewatcher in the correct package
Fastd information should read from nodewatcher from the fastd package

With this patch it's possible to add wireguard information for layer3 in the correct package

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
2021-01-29 09:06:39 +01:00
3 changed files with 16 additions and 5 deletions

View File

@ -0,0 +1,8 @@
#!/bin/sh
# Netmon Nodewatcher (C) 2010-2012 Freifunk Oldenburg
# License; GPL v3
# Checks if fastd is running
vpn_active=0
pidof fastd >/dev/null && vpn_active=1
SYSTEM_DATA="$SYSTEM_DATA<vpn_active>$vpn_active</vpn_active>"

View File

@ -107,11 +107,6 @@ if [ -s "$SCRIPT_STATUS_FILE" ]; then
SYSTEM_DATA="$SYSTEM_DATA<status_text>$(cat "$SCRIPT_STATUS_FILE")</status_text>"
fi
# Checks if fastd is running
vpn_active=0
pidof fastd >/dev/null && vpn_active=1
SYSTEM_DATA="$SYSTEM_DATA<vpn_active>$vpn_active</vpn_active>"
echo -n "<system_data>$SYSTEM_DATA</system_data>"
exit 0

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>"