Show process in output (steps)
This commit is contained in:
parent
f38cb6b564
commit
f18e4a7586
@ -12,6 +12,8 @@ mqttHost=$1
|
|||||||
mqttPrefix=$2
|
mqttPrefix=$2
|
||||||
homieId=$3
|
homieId=$3
|
||||||
|
|
||||||
|
maxSteps=6
|
||||||
|
|
||||||
settingsFile=settings.json
|
settingsFile=settings.json
|
||||||
if [ ! -f $settingsFile ]; then
|
if [ ! -f $settingsFile ]; then
|
||||||
echo "$settingsFile missing"
|
echo "$settingsFile missing"
|
||||||
@ -20,20 +22,20 @@ if [ ! -f $settingsFile ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "1" -r
|
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "1" -r
|
||||||
echo "Waiting ..."
|
echo "(1 / $maxSteps) Waiting ..."
|
||||||
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
|
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
|
||||||
set -e
|
set -e
|
||||||
echo "Waiting 30 seconds ..."
|
echo "(2 / $maxSteps) Waiting 30 seconds ..."
|
||||||
sleep 30
|
sleep 30
|
||||||
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/\$implementation/config/set" -f $settingsFile
|
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/\$implementation/config/set" -f $settingsFile
|
||||||
echo "Waiting for reboot ..."
|
echo "(3 / $maxSteps) Waiting for reboot ..."
|
||||||
sleep 1
|
sleep 1
|
||||||
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
|
mosquitto_sub -h $mqttHost -t "${mqttPrefix}${homieId}/#" -R -C 1
|
||||||
echo "Alive"
|
echo "(4 / $maxSteps) Alive"
|
||||||
sleep 20
|
sleep 20
|
||||||
echo "Create Backup ..."
|
echo "(5 / $maxSteps) Create Backup ..."
|
||||||
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/config/backup/set" -m "true" -r
|
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/config/backup/set" -m "true" -r
|
||||||
sleep 5
|
sleep 5
|
||||||
echo "Shutdown ..."
|
echo "(6 / $maxSteps) Shutdown ..."
|
||||||
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "0" -r
|
mosquitto_pub -h $mqttHost -t "${mqttPrefix}${homieId}/stay/alive/set" -m "0" -r
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user