emqx/scripts/mosquitto_test

20 lines
485 B
Bash
Executable File

#!/bin/sh
# -*- tab-width:4;indent-tabs-mode:nil -*-
# ex: ts=4 sw=4 et
# slimple publish
mosquitto_pub -t xxx/yyy -m hello
if [ "$?" == 0 ]; then
echo "[Success]: slimple publish"
else
echo "[Failure]: slimple publish"
fi
# publish will willmsg
mosquitto_pub -q 1 -t a/b/c -m hahah -u test -P public --will-topic /will --will-payload willmsg --will-qos 1
if [ "$?" == 0 ]; then
echo "[Success]: publish with willmsg"
else
echo "[Failure]: publish with willmsg"
fi