forked from freifunk-franken/firmware
64 lines
2.3 KiB
Plaintext
Executable File
64 lines
2.3 KiB
Plaintext
Executable File
#!/usr/bin/haserl
|
|
<% echo -en "content-type: text/html\r\n\r\n" %>
|
|
<% . /etc/firmware_release %>
|
|
<!DOCTYPE html>
|
|
<html lang="de"><head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>info</title>
|
|
<link rel="stylesheet" href="/css/pure-min.css">
|
|
<link rel="stylesheet" href="/css/side-menu.css">
|
|
<link rel="stylesheet" href="/css/grids-responsive-min.css">
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
</head>
|
|
<body>
|
|
<div class="header">
|
|
<div class="home-menu pure-menu pure-menu-open pure-menu-horizontal pure-menu-fixed">
|
|
<a class="pure-menu-heading" href="http://www.freifunk-franken.de">freifunk-franken.de</a>
|
|
<ul>
|
|
<%
|
|
contact="$(uci get -q freifunk.@settings[0].contact)"
|
|
if [ -n "$contact" ]; then
|
|
echo " <li><a href='#'>Kontakt: $contact</a></li>"
|
|
fi
|
|
|
|
geo="$(uci get -q freifunk.@settings[0].geo)"
|
|
if [ -n "$geo" ]; then
|
|
lat="${geo%% *}" lon="${geo##* }"
|
|
echo " <li><a href=\"https://www.openstreetmap.org?mlat=$lat&mlon=$lon&zoom=17\">Position: ${lat:0:8}N, ${lon:0:8}E</a></li>"
|
|
fi
|
|
%>
|
|
<li><form action="https://<% echo -n "$HTTP_HOST" %>"><button type="submit" class="pure-button">Login</button></form></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="header">
|
|
<%
|
|
echo " <h1>$(uci get -q freifunk.@settings[0].name)</h1>"
|
|
%>
|
|
<h2>Firmware Version <% echo -n $FIRMWARE_VERSION %></h2>
|
|
</div>
|
|
<div class="content">
|
|
<div class="pure-g" style="text-align:center;">
|
|
<div class="pure-u-1 pure-u-md-1-3">
|
|
<div class="blockhead"></div>
|
|
<h2>Nachbarknoten</h2>
|
|
<h3><% echo -n $(cat /sys/kernel/debug/batman_adv/bat0/originators | grep '^[0-9a-f]' | cut -b 37-53 | sort | uniq | wc -l 2> /dev/null) %></h3>
|
|
</div>
|
|
<div class="pure-u-1 pure-u-md-1-3">
|
|
<div class="blockhead"></div>
|
|
<h2>Alle Knoten</h2>
|
|
<h3><% echo -n $((`cat /sys/kernel/debug/batman_adv/bat0/transtable_global | grep '^ [^ ]' | cut -b 39-55 | sort | uniq | wc -l 2> /dev/null`+1)) %></h3>
|
|
</div>
|
|
<div class="pure-u-1 pure-u-md-1-3">
|
|
<div class="blockhead"></div>
|
|
<h2>Lokale Clients</h2>
|
|
<h3><% echo -n $(cat /sys/kernel/debug/batman_adv/bat0/transtable_local 2> /dev/null | grep -c 'W') %></h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|