MQTT Listner

Hi There,

I’m looking for a simple mqtt listener script.

I have 2 pi’s. One that’s run Home Assistant and one that runs my MQTT broker and a sms portal. I want to send a MQTT notification that will trigger a bash script on my mqtt pi. The script will send a sms when the internet is down.
Does someone has a simple script that will listen to specific topic and can run a shell script?
Thx

If you want do it in Python, you need something like the final post from this raspberry pi topic, but replace the GPIO bit in the on_message callback with a subprocess.call()