fff-web-ui: Only show batman-adv data if batctl exists

To prevent the follow error in logread at layer 3 firmware:

uhttpd[1700]: /bin/sh: batctl: not found

remove batctl from webui if no batctl exist

Signed-off-by: Christian Dresel <freifunk@dresel.systems>
This commit is contained in:
Christian Dresel 2022-04-16 10:37:52 +02:00
parent 20d12f943e
commit ae970828a1
1 changed files with 2 additions and 0 deletions

View File

@ -57,6 +57,7 @@ contact="$(uci -q get "fff.system.contact")"
</table>
</fieldset>
</td><td>
<% if [ -f "$(command -v batctl)" ] ; then %>
<fieldset style="min-height: 15em;">
<legend>Status</legend>
<table>
@ -66,6 +67,7 @@ contact="$(uci -q get "fff.system.contact")"
<tr><th>Lokale Clients:</th><td><% echo -n $(batctl tl -H 2> /dev/null | grep -c 'W') %></td></tr>
</table>
</fieldset>
<% fi %>
</td></tr>
</table>
</div>