guowenxue
2019-07-31 1284cbb2edeb564f4b4f12c154a72c034bb2af6a
Update mqttd subscribe test shell script
1 files added
1 files renamed
35 ■■■■■ changed files
mqttd/tools/pub_test.sh patch | view | raw | blame | history
mqttd/tools/sub_test.sh 35 ●●●●● patch | view | raw | blame | history
mqttd/tools/pub_test.sh
mqttd/tools/sub_test.sh
New file
@@ -0,0 +1,35 @@
#!/bin/bash
progname=mosquitto_sub
hostname="master.iot-yun.club"
port=10883
uid="lingyun"
pwd="lingyun-emb"
dltopic="\$Sys/Studio/Downlink"
uptopic="\$Sys/Studio/Uplink"
sub_command="$progname -h $hostname -p $port -u $uid -P $pwd -t "
topics=("" "$uptopic" "$dltopic" )
echo ""
echo "Please select a subscribe topic:"
echo "1, < Uplink Topic >: Device ---> Server message"
echo "2, <Downlink Topic>: Server ---> Device message"
echo ""
stty erase '^H'
read -p "Enter your choise [1/2] : " choice
if [ $choice -gt 2 ] ; then
    echo "ERROR: Invalid input choice, exit now..."
    exit 1;
fi
topic=${topics[$choice]}
set -x
$sub_command $topic