HD-PVR Power Cycle by Module Reload
|Description||A method to power cycle the HD-PVR by reloading the driver module|
multi HD-PVR safe module reload script
This is another method of "power-cycling" the HD-PVR for when it fails to properly record. Much like the actions taken by "HD-PVR Killer Device", this attempts to leverage the idea that just reloading the driver modules will achieve the same result.
It is intended that this script be run via the /etc/cron.hourly directory. As such a control allowing you to limit the hours between which the script will run are in place.
This script has some variables at the beginning that the user must set, this includes user and password for your mythweb installation if you have them set.
The other is the above mentioned hour control, MINHR and MAXHR, which are to be set in 24h format (ie 1pm = 13). If you wish to allow it to run at any time setting the values to MINHR=0 and MAXHR=25 should work.
You can also have it log the output to a log file, which is what the first few lines accomplish, which can be commented out for testing on the command line.
The actual module commands are in a second script, to allow for easier testing, but can easily be rolled into the main script. That script is below the script to check the HD-PVR status.
Final word of note, this is set up for an English system so if you are running in another language you will have to modify the commands to account for the language difference.
this is the code to actually unload and load the driver module