From 40fce7763e1b190b056568e597019a06b3dee6d6 Mon Sep 17 00:00:00 2001 From: Ollo Date: Thu, 6 Jan 2022 16:35:41 +0100 Subject: [PATCH] Use a timeout to activate Telnet server --- tools/remoteFlash.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/remoteFlash.sh b/tools/remoteFlash.sh index 2bdeb47..a46fd35 100755 --- a/tools/remoteFlash.sh +++ b/tools/remoteFlash.sh @@ -62,9 +62,14 @@ if [ $? -ne 0 ]; then echo "Entered Wordclock address: $MQTTPREFIX on $MQTTSERVER is NOT online" exit 2 fi -echo "Activate Telnet server" -mosquitto_pub -h $MQTTSERVER -t "$MQTTPREFIX/cmd/telnet" -m "a" -TELNETIP=$(mosquitto_sub -h $MQTTSERVER -t "$MQTTPREFIX/telnet" -C 1) +echo "Activate Telnet server ..." +TELNETIP="empty" +while [ "$TELNETIP" = "empty" ]; do + date + mosquitto_pub -h $MQTTSERVER -t "$MQTTPREFIX/cmd/telnet" -m "a" + TELNETIP=$(mosquitto_sub -h $MQTTSERVER -t "$MQTTPREFIX/telnet" -C 1 -W 30) +done + echo "Upgrading $MQTTPREFIX via telenet on $TELNETIP ..." sleep 1 echo "if (mlt ~= nil) then mlt:unregister() end" > $UPGRADEPREP