mosquitto_test 485 B

12345678910111213141516171819
  1. #!/bin/sh
  2. # -*- tab-width:4;indent-tabs-mode:nil -*-
  3. # ex: ts=4 sw=4 et
  4. # slimple publish
  5. mosquitto_pub -t xxx/yyy -m hello
  6. if [ "$?" == 0 ]; then
  7. echo "[Success]: slimple publish"
  8. else
  9. echo "[Failure]: slimple publish"
  10. fi
  11. # publish will willmsg
  12. mosquitto_pub -q 1 -t a/b/c -m hahah -u test -P public --will-topic /will --will-payload willmsg --will-qos 1
  13. if [ "$?" == 0 ]; then
  14. echo "[Success]: publish with willmsg"
  15. else
  16. echo "[Failure]: publish with willmsg"
  17. fi