#!/bin/bash progname=mosquitto_pub hostname="master.iot-yun.com" port=10883 uid="lingyun" pwd="lingyun-emb" dltopic="\$Sys/Studio/Downlink" uptopic="\$Sys/Studio/Uplink" pub_downlink_cmd="$progname -h $hostname -p $port -u $uid -P $pwd -t "$dltopic" -m " pub_uplink_cmd="$progname -h $hostname -p $port -u $uid -P $pwd -t "$uptopic" -m " set -x $pub_downlink_cmd '{"id":"x86host02","camera" : "on" }' #sleep 5 #$pub_downlink_cmd '{"id":"x86host02","camera" : "off" }'