From 13a8daf96e121d9ab5cb9a36555490f9cf7ff117 Mon Sep 17 00:00:00 2001 From: Maximilian Wilhelm Date: Tue, 6 Oct 2020 05:17:48 +0200 Subject: [PATCH] batman executor: Work around excution order limitations for now. Signed-off-by: Maximilian Wilhelm --- executor-scripts/linux/batman | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/executor-scripts/linux/batman b/executor-scripts/linux/batman index 62f4f6e..dd984ec 100644 --- a/executor-scripts/linux/batman +++ b/executor-scripts/linux/batman @@ -68,13 +68,18 @@ set_routing_algo () { # # Functions to manage B.A.T.M.A.N. adv. underlay interfaces (hardifs) set_hardif_options () { - if [ "${IF_BATMAN_HOP_PENALTY}" ]; then - ${MOCK} batctl hardif "${IFACE}" hop_penalty "${IF_BATMAN_HOP_PENALTY}" - fi + # Query hardif parameter manually for now + for hardif in ${IF_BATMAN_IFACES}; do + penalty=$(ifquery -p "batman-hop-penalty" "${hardif}") + if [ "${penalty}" ]; then + ${MOCK} batctl hardif "${hardif}" hop_penalty "${penalty}" + fi - if [ "${IF_BATMAN_THROUGHPUT_OVERRIDE}" ]; then - ${MOCK} batctl hardif "${IFACE}" throughput_override "${IF_BATMAN_THROUGHPUT_OVERRIDE}" - fi + throughput=$(ifquery -p "batman-throughput-override" "${hardif}") + if [ "${throughput}" ]; then + ${MOCK} batctl hardif "${hardif}" throughput_override "${througput}" + fi + done } @@ -103,9 +108,6 @@ case "${PHASE}" in if [ "${IF_BATMAN_IFACES}" ]; then batctl_if add set_meshif_options - - # B.A.T.M.A.N. adv. underlay interface (hardif) - elif [ "${IF_BATMAN_HOP_PENALTY}" -o "${IF_BATMAN_THROUGHPUT_OVERRIDE}" ]; then set_hardif_options fi ;;