gluon-mesh-batman-adv: add batctl wrapper for batman-adv vs. -legacy

This commit adds a transparent wrapper which depending on the selected
batman-adv routing algorithm calls either /usr/sbin/batctl or
/usr/sbin/batctl-legacy.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
This commit is contained in:
Linus Lüssing 2018-11-27 05:42:37 +01:00
parent c10c54e807
commit c007fe92c1
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,3 @@
#!/bin/sh
export PATH="/usr/local/sbin:$PATH"

View File

@ -0,0 +1,9 @@
#!/bin/sh
routing_algo="$(uci -q get batman-adv.bat0.routing_algo || echo 'BATMAN_IV')"
if [ "$routing_algo" = "BATMAN_IV_LEGACY" ]; then
exec /usr/sbin/batctl-legacy $@
else
exec /usr/sbin/batctl $@
fi