From c007fe92c1f5bb99a6ff6bd12343f694b3190b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20L=C3=BCssing?= Date: Tue, 27 Nov 2018 05:42:37 +0100 Subject: [PATCH] gluon-mesh-batman-adv: add batctl wrapper for batman-adv vs. -legacy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../files/etc/profile.d/001-gluon-mesh-batman-adv.sh | 3 +++ .../gluon-mesh-batman-adv/files/usr/local/sbin/batctl | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100755 package/gluon-mesh-batman-adv/files/etc/profile.d/001-gluon-mesh-batman-adv.sh create mode 100755 package/gluon-mesh-batman-adv/files/usr/local/sbin/batctl diff --git a/package/gluon-mesh-batman-adv/files/etc/profile.d/001-gluon-mesh-batman-adv.sh b/package/gluon-mesh-batman-adv/files/etc/profile.d/001-gluon-mesh-batman-adv.sh new file mode 100755 index 00000000..df550ed2 --- /dev/null +++ b/package/gluon-mesh-batman-adv/files/etc/profile.d/001-gluon-mesh-batman-adv.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +export PATH="/usr/local/sbin:$PATH" diff --git a/package/gluon-mesh-batman-adv/files/usr/local/sbin/batctl b/package/gluon-mesh-batman-adv/files/usr/local/sbin/batctl new file mode 100755 index 00000000..32797131 --- /dev/null +++ b/package/gluon-mesh-batman-adv/files/usr/local/sbin/batctl @@ -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