Skip to content

Commit

Permalink
Add ap+mesh_scc/mcc possibility with multiradio
Browse files Browse the repository at this point in the history
Jira-Id: SCDI-43

Signed-off-by: Mika Joenpera <[email protected]>
  • Loading branch information
joenpera committed Oct 17, 2023
1 parent 4e8a832 commit 544e22a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
22 changes: 11 additions & 11 deletions modules/sc-mesh-secure-deployment/src/nats/initd/S9011sNatsMesh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand All @@ -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"
}
Expand Down
7 changes: 6 additions & 1 deletion modules/utils/docker/entrypoint_nats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 544e22a

Please sign in to comment.