[mythtv-users] Remotely monitor Backend is running

Barry Martin barry3martin at gmail.com
Wed Oct 13 16:23:41 UTC 2021


Hi Charles!
> Crontab
> 29,59 * * * * /home/username/resetMyth.sh
>
> Script
> #!/bin/bash
>
> SHOWS=$(curl -H "Accept: application/json"http://mythtv:6544/Dvr/GetUpcomingList  2> /dev/null | jq .ProgramList.Count | cut -d '"' -f 2)
> if [ $SHOWS -eq 0 ]; then
> 	echo "Restarting Myth Backend"
> 	sudo systemctl restart mythtv-backend
> fi


And a thank you to you too! The half-hour check by the cron job to so an 
automatic reset will be handy – I’m not always at the computer! (Is that 
blasphemous?! <g>)

Your curl command (at least when I isolate it and test at Terminal) 
results in just a number, which for a cookbook scripter like me will 
probably be a lot easier to use.


Barry



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20211013/7d6d7398/attachment.htm>


More information about the mythtv-users mailing list