From patchwork Mon May 29 20:09:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [5/5] WebUI: show VPN status for both fastd and l2tp individually (adds L2TP status) From: Adrian Schmutzler X-Patchwork-Id: 338 Message-Id: <1496088554-44800-1-git-send-email-freifunk@adrianschmutzler.de> To: franken-dev@freifunk.net Cc: Adrian Schmutzler Date: Mon, 29 May 2017 22:09:14 +0200 --- src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) Reviewed-by: Zeilen für die Dokumentation zu nutzen. diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html index 9ca0107..fd0d8b4 100755 --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html +++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html @@ -4,9 +4,14 @@ <%in /www/ssl/cgi-bin/helpers %> <% if pidof fastd >/dev/null ; then - vpn_active="Ja" + vpn_active="aktiv" else - vpn_active="Nein" + vpn_active="inaktiv" +fi +if grep -q '1' /sys/class/net/l2tp*/carrier ; then + l2tp_active="aktiv" +else + l2tp_active="inaktiv" fi up="$(uptime)" load="${up##*:}" @@ -42,7 +47,8 @@ fi MAC-Adresse:<% uci -q get network.mesh.macaddr %> Bekannte Knoten:<%= $((`cat /sys/kernel/debug/batman_adv/bat0/transtable_global | grep '^ [^ ]' | cut -b 39-55 | sort | uniq | wc -l 2>/dev/null`+1)) %> Nachbarknoten:<%= $(cat /sys/kernel/debug/batman_adv/bat0/originators | grep '^[0-9a-f]' | cut -b 37-53 | sort | uniq | wc -l 2>/dev/null) %> - VPN Aktiv:<%= ${vpn_active} %> + VPN via fastd:<%= ${vpn_active} %> + VPN via L2TP:<%= ${l2tp_active} %> Laufzeit:<%= ${uptime} %> Auslastung:<%= ${load} %> Uhrzeit:<% date %>