[mythtv-users] Backend Reboot Script
Ian Clark
mrrooster at gmail.com
Thu Jun 18 10:57:33 UTC 2015
On 15 June 2015 at 02:25, Michael Wisniewski <mikewiz38 at gmail.com> wrote:
> I was wondering if anybody out there has a reboot or shutdown script that
> would prevent it if the backend is recording.
>
> There's been a few times where I'll do a reboot and then find out later that
> myth was recording something, then the recording will fail. I could
> probably whip something together, but thought I would ask here to see if
> somebody has already done this.
>
mythshutdown is your friend here....
#!/bin/sh
mythshutdown -c
if [ "$?" == "0"]; then
shutdown -r now
else
echo "shutdown blocked..."
fi
^-- untested, but basically that should work. Won't shutdown if it's
recording or about to start recording.
mythshutdown -c sets the return value to 0 if it's safe to shutdown.
Cheers,
Ian
More information about the mythtv-users
mailing list