2016-03-13 13:32:12 +01:00
|
|
|
#!/usr/bin/haserl
|
|
|
|
|
2017-10-08 16:14:03 +02:00
|
|
|
<%
|
2017-11-06 10:18:09 +01:00
|
|
|
# read from keyxchangev2data
|
|
|
|
. /lib/functions/fff/evalhoodinfo
|
2017-10-30 20:08:27 +01:00
|
|
|
|
2017-10-08 16:14:03 +02:00
|
|
|
# prepare
|
2018-07-26 19:22:22 +02:00
|
|
|
if [ "$REQUEST_METHOD" = "POST" ] ; then
|
2017-10-08 16:14:03 +02:00
|
|
|
if [ "$POST_resethood" != "" ] ; then
|
|
|
|
# reset hood
|
2018-07-25 15:58:15 +02:00
|
|
|
rm "$hoodfileref" 2> /dev/null
|
2017-10-08 16:14:03 +02:00
|
|
|
MSG='<span class="green">Hood-Daten werden innerhalb von 5 Minuten neu prozessiert.</span>'
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
%>
|
2016-03-13 13:32:12 +01:00
|
|
|
<%in /www/ssl/cgi-bin/header %>
|
|
|
|
<%in /www/ssl/cgi-bin/helpers %>
|
2017-10-08 16:14:03 +02:00
|
|
|
<% show_msg %>
|
2016-03-13 13:32:12 +01:00
|
|
|
<%
|
|
|
|
if pidof fastd >/dev/null ; then
|
2017-05-30 12:21:15 +02:00
|
|
|
vpn_active="aktiv"
|
2016-03-13 13:32:12 +01:00
|
|
|
else
|
2017-05-30 12:21:15 +02:00
|
|
|
vpn_active="inaktiv"
|
|
|
|
fi
|
|
|
|
if grep -q '1' /sys/class/net/l2tp*/carrier ; then
|
|
|
|
l2tp_active="aktiv"
|
|
|
|
else
|
|
|
|
l2tp_active="inaktiv"
|
2016-03-13 13:32:12 +01:00
|
|
|
fi
|
|
|
|
up="$(uptime)"
|
|
|
|
load="${up##*:}"
|
|
|
|
uptime="${up%%,*}"
|
|
|
|
uptime="${uptime##*up}"
|
|
|
|
|
|
|
|
#include OpenWrt version
|
|
|
|
. /etc/openwrt_release
|
|
|
|
. /etc/firmware_release
|
|
|
|
|
|
|
|
addr() {
|
|
|
|
local addr="$(ip -$1 address show dev $2 2>/dev/null | tr '/' ' '| awk '/inet/{ printf("%s<br />", $2); }')"
|
|
|
|
echo "${addr:--}"
|
|
|
|
}
|
|
|
|
default_gw() {
|
|
|
|
ip -$1 route list 0/0 dev $2 2> /dev/null | awk '{print($3); exit(0)}'
|
|
|
|
}
|
|
|
|
wanif=$(uci -q get network.wan.ifname)
|
|
|
|
if [ -n "$(default_gw 4 $wanif)" -o -n "$(default_gw 6 $wanif)" ]; then
|
|
|
|
internet_active="Ja"
|
|
|
|
else
|
|
|
|
internet_active="Nein"
|
|
|
|
fi
|
|
|
|
|
|
|
|
%>
|
|
|
|
<table style="width: 100%;">
|
|
|
|
<tr><td>
|
2017-11-06 10:18:09 +01:00
|
|
|
<fieldset style="padding-bottom:12px">
|
2016-03-13 13:32:12 +01:00
|
|
|
<legend>System</legend>
|
|
|
|
<table>
|
|
|
|
<tr><th>Name:</th><td><%= ${HOSTNAME} %></td></tr>
|
|
|
|
<tr><th>Modell:</th><td><% cat /tmp/sysinfo/model 2>/dev/null %></td></tr>
|
2017-06-13 14:09:25 +02:00
|
|
|
<tr><th>MAC-Adresse:</th><td><%= $(cat /sys/class/net/br-mesh/address) %></td></tr>
|
2019-03-25 13:09:46 +01:00
|
|
|
<tr><th>Bekannte Knoten:</th><td><%= $(($(batctl tg -H | cut -b 40-56 | sort | uniq | wc -l 2>/dev/null)+1)) %></td></tr>
|
|
|
|
<tr><th>Nachbarknoten:</th><td><%= $(batctl o -H | cut -b 40-56 | sort | uniq | wc -l 2>/dev/null) %></td></tr>
|
2017-05-30 12:21:15 +02:00
|
|
|
<tr><th>VPN via fastd:</th><td><%= ${vpn_active} %></td></tr>
|
|
|
|
<tr><th>VPN via L2TP:</th><td><%= ${l2tp_active} %></td></tr>
|
2016-03-13 13:32:12 +01:00
|
|
|
<tr><th>Laufzeit:</th><td><%= ${uptime} %></td></tr>
|
|
|
|
<tr><th>Auslastung:</th><td><%= ${load} %></td></tr>
|
|
|
|
<tr><th>Uhrzeit:</th><td><% date %></td></tr>
|
|
|
|
</table>
|
|
|
|
</fieldset>
|
2017-11-06 10:18:09 +01:00
|
|
|
<fieldset style="padding-bottom:12px">
|
|
|
|
<legend>Netz: Freifunk</legend>
|
|
|
|
<table>
|
2019-03-25 13:09:46 +01:00
|
|
|
<tr><th>Nutzer:</th><td><% batctl tl -H 2> /dev/null | grep -c 'W' %></td></tr>
|
2017-11-06 10:18:09 +01:00
|
|
|
<tr><th>Empfangen:</th><td><% cat /sys/class/net/br-mesh/statistics/rx_bytes 2> /dev/null | human_bytes %></td></tr>
|
|
|
|
<tr><th>Gesendet:</th><td><% cat /sys/class/net/br-mesh/statistics/tx_bytes 2> /dev/null | human_bytes %></td></tr>
|
|
|
|
<tr><th>IPv4 Adressen:</th><td><% addr 4 br-mesh %></td></tr>
|
|
|
|
<tr><th>IPv6 Adressen:</th><td><% addr 6 br-mesh %></td></tr>
|
|
|
|
</table>
|
|
|
|
</fieldset>
|
2016-03-13 13:32:12 +01:00
|
|
|
</td><td>
|
2017-11-06 10:18:09 +01:00
|
|
|
<fieldset style="padding-bottom:12px">
|
2016-03-13 13:32:12 +01:00
|
|
|
<legend>Software</legend>
|
|
|
|
<table>
|
|
|
|
<tr><th>Firmware Version:</th><td><%= ${FIRMWARE_VERSION} %></td></tr>
|
2016-08-11 22:02:03 +02:00
|
|
|
<tr><th>OpenWrt Version:</th><td><%= ${DISTRIB_DESCRIPTION} %></td></tr>
|
2016-03-13 13:32:12 +01:00
|
|
|
<tr><th>Kernel Version:</th><td><% uname -s -m -r %></td></tr>
|
|
|
|
<tr><th>Batman-Adv Version:</th><td><% cat /sys/module/batman_adv/version 2>/dev/null %></td></tr>
|
|
|
|
<tr><th>Fastd Version:</th><td><% fastd --version 2> /dev/null | cut -d' ' -f 2 %></td></tr>
|
|
|
|
</table>
|
|
|
|
</fieldset>
|
2017-10-08 16:14:03 +02:00
|
|
|
<form method="post">
|
2017-11-06 10:18:09 +01:00
|
|
|
<fieldset style="padding-bottom:12px">
|
2017-10-08 16:14:03 +02:00
|
|
|
<legend>Hood</legend>
|
|
|
|
<table>
|
|
|
|
<tr><th style="width:200px">Hood:</th><td><% echo "$hood" %></td></tr>
|
|
|
|
<tr><th style="width:200px">Mesh-Type (2.4/5 GHz):</th><td><% echo "${mesh_type2} / ${mesh_type5}" %></td></tr>
|
2017-11-06 10:18:09 +01:00
|
|
|
<tr><th style="width:200px">Channel (2.4/5 GHz):</th><td>Gerät: <% echo "${real_chan2ghz} / ${real_chan5ghz}" %> | Hood: <% echo "${chan2ghz} / ${chan5ghz}" %></td></tr>
|
|
|
|
<tr><th style="width:200px">SSID (Client-AP):</th><td>Gerät: <% echo "${real_essid}" %> | Hood: <% echo "${essid}" %></td></tr>
|
2017-10-08 16:14:03 +02:00
|
|
|
<tr><td colspan="2"> </td></tr>
|
|
|
|
<tr><td colspan="2">Beim Klicken werden die Hood-Daten innerhalb von 5 Minuten neu abgerufen und angewandt:</td></tr>
|
|
|
|
<tr><td colspan="2"><input type="submit" name="resethood" value="Reset hood data" /></td></tr>
|
|
|
|
</table>
|
|
|
|
</fieldset>
|
|
|
|
</form>
|
2017-11-06 10:18:09 +01:00
|
|
|
<fieldset style="padding-bottom:12px">
|
2016-03-13 13:32:12 +01:00
|
|
|
<legend>Netz: WAN</legend>
|
|
|
|
<table>
|
|
|
|
<tr><th>Internet vorhanden:</th><td><%= ${internet_active} %></td></tr>
|
2017-08-10 15:53:31 +02:00
|
|
|
<tr><th>Empfangen:</th><td><% cat /sys/class/net/${wanif}/statistics/rx_bytes 2> /dev/null | human_bytes %></td></tr>
|
|
|
|
<tr><th>Gesendet:</th><td><% cat /sys/class/net/${wanif}/statistics/tx_bytes 2> /dev/null | human_bytes %></td></tr>
|
2016-03-13 13:32:12 +01:00
|
|
|
<tr><th>IPv4 Adressen:</th><td><% addr 4 $wanif %></td></tr>
|
|
|
|
<tr><th>IPv6 Adressen:</th><td><% addr 6 $wanif %></td></tr>
|
|
|
|
</table>
|
|
|
|
</fieldset>
|
|
|
|
</td></tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<%in /www/ssl/cgi-bin/footer %>
|