remove messages in mqtt by topic

This commit is contained in:
2019-12-10 20:05:02 +01:00
parent e847c5cbfc
commit 8f22b8bbdf

3
mqtt/remove_retained_topic.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
echo "cleaning " $1 " :: usage: cleanmqtt <host> <topic>"
mosquitto_sub -h $1 -t "${2}/#" -v | while read line; do mosquitto_pub -h $1 -t "${line% *}" -r -n; done