chore: add clear.sh tool for clearing retained messages in MQTT broker
parent
3d412f20f7
commit
c16680bd04
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mosquitto_sub -h mosquitto.graystorm.com -v -t '#' --retained-only \
|
||||||
|
| grep 'amcrest2mqtt' \
|
||||||
|
| while read -r topic payload ; do
|
||||||
|
mosquitto_pub -h mosquitto.graystorm.com -t "$topic" -n -r
|
||||||
|
echo "Purged $topic"
|
||||||
|
done
|
||||||
|
echo "done."
|
||||||
Loading…
Reference in New Issue