79163319

Date: 2024-11-06 15:55:51
Score: 3
Natty:
Report link

Not enough reputation to comment on Gussoh's answer, so I have to write my solution (which is based on his) here: I had to do it like this:

mosquitto_sub -h 192.168.1.20 -t "#" -v --retained-only | while read line; do echo "$line" | awk '{print $1}'; done > retained.txt

<retained.txt xargs -I % mosquitto_pub -h 192.168.1.20 -t % -n -r -d

You can probably do it without using a file here, but this way I could check if everything was included.

Reasons:
  • Blacklisted phrase (1): to comment
  • RegEx Blacklisted phrase (1.5): enough reputation to comment
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: fredlcore