#!/bin/sh PRE=01_MythTV if [ "$1" = "suspend" ]; then # Log process tree echo "!!process tree" pstree echo "!!Stopping MythTV Frontend" killall mythfrontend.real # Just log the RTC Alarm echo "$PRE: cat /proc/driver/rtc:" cat /proc/driver/rtc echo "$PRE: Now is `date --rfc-3339=seconds`. Suspending..." | tee -a $LOG # stop mythtv-backend echo "!!Stopping MythTV Backend" # Usual service stopping interrupts this script by killing all descendants # Can be reproduced by sleep invocation from MythTV backend only kill -15 `pidof mythbackend` # removing Afatech drivers otherwise sleeping fails rmmod dvb_usb_af9015 af9013 fi if [ "$1" = "resume" ]; then echo "$PRE: Now is `date --rfc-3339=seconds`. Resuming..." | tee -a $LOG echo "!!inserting kernel modules" modprobe af9013 modprobe dvb_usb_af9015 echo "!!Restarting MythTV Backend" /etc/init.d/mythtv-backend stop /etc/init.d/mythtv-backend start fi