From 544e22a0e15646a7de2cfcace05b031f85dfea07 Mon Sep 17 00:00:00 2001 From: Mika Joenpera Date: Tue, 17 Oct 2023 14:13:18 +0300 Subject: [PATCH] Add ap+mesh_scc/mcc possibility with multiradio Jira-Id: SCDI-43 Signed-off-by: Mika Joenpera --- .../src/nats/initd/S9011sNatsMesh | 22 +++++++++---------- modules/utils/docker/entrypoint_nats.sh | 7 +++++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/modules/sc-mesh-secure-deployment/src/nats/initd/S9011sNatsMesh b/modules/sc-mesh-secure-deployment/src/nats/initd/S9011sNatsMesh index 760e28f57..ba9441ee0 100644 --- a/modules/sc-mesh-secure-deployment/src/nats/initd/S9011sNatsMesh +++ b/modules/sc-mesh-secure-deployment/src/nats/initd/S9011sNatsMesh @@ -13,7 +13,7 @@ source /opt/mesh-helper.sh # sources mesh configuration -RADIO_INDEX=$2 # $1: index of the mesh.conf file to be used e.g. "id0" +RADIO_INDEX=$2 # $2: index of the mesh.conf file to be used e.g. "id0" source_configuration "${RADIO_INDEX:2}" @@ -29,17 +29,17 @@ LOG_FILE=/opt/mesh_11s_${RADIO_INDEX}_${!_WIFI}.log start() { printf 'Starting %s: ' "$DAEMON" - if [ "${!_MODE}" == "mesh" ] || [ "${!_MODE}" == "halow" ]; then - start-stop-daemon -b -m -S -q -p "$PIDFILE" -a /bin/bash -- -c "exec $DIR$DAEMON ${!_MODE} $RADIO_INDEX > $LOG_FILE 2>&1" - status=$? - if [ "$status" -eq 0 ]; then - echo "OK" - else - echo "FAIL" - fi + if [ "${!_MODE}" == "ap+mesh_scc" ] || [ "${!_MODE}" == "ap+mesh_mcc" ]; then + mode=mesh else - echo "mesh/halow not starting..." - return 0 + mode=${!_MODE} + fi + start-stop-daemon -b -m -S -q -p "$PIDFILE" -a /bin/bash -- -c "exec $DIR$DAEMON $mode $RADIO_INDEX > $LOG_FILE 2>&1" + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" fi return "$status" } diff --git a/modules/utils/docker/entrypoint_nats.sh b/modules/utils/docker/entrypoint_nats.sh index b096d6c7f..1eb7d54f9 100755 --- a/modules/utils/docker/entrypoint_nats.sh +++ b/modules/utils/docker/entrypoint_nats.sh @@ -31,9 +31,14 @@ else /opt/S9011sNatsMesh start id2 fi - echo "starting AP service" /opt/S90APoint start id0 + if [ -f "/opt/1_mesh.conf" ]; then + /opt/S90APoint start id1 + fi + if [ -f "/opt/2_mesh.conf" ]; then + /opt/S90APoint start id2 + fi echo "wait for bridge to be up..." while ! (ifconfig | grep -e "$br_lan_ip") > /dev/null; do