#!/bin/sh RES=`htb_status` if [ "x$RES" != "xON" ]; then echo "beamer is not ON" exit 1 fi RES=`htb_standby` if [ "x$RES" != "xPENDING_STANDBY" ]; then echo "command to switch on not accepted by beamer" exit 1 fi sleep 3 RES=`htb_status` MAX=60 COUNT=0 while [ "x$RES" != "xSTANDBY" ]; do COUNT=$(($COUNT + 1)) if [ $COUNT -gt $MAX ]; then echo "beamer not responding to status query while it should switch to standby" exit 1 fi sleep 1 done mosquitto_pub -t "/dingtian/relay2332/in/r6" -m OFF