Rbautch Enhancement Script

From DVRpedia

Jump to: navigation, search

Where to get it

http://www.tivocommunity.com/tivo-vb/showthread.php?threadid=250680

What the Script Does

  • 1. Installs channel logos on the guide banner and Now Playing list (if you haven’t already loaded them).
  • 2. Replaces the “Almost There” splash screen with this more interesting one. The script backs up your existing splash screen in /tvbin/AlmostThere.png.bak. Tivo is very particular about the format of the graphic you use for the splash screen. I had to pull my drive a few times so you don’t have to. If there’s interest, I’ll eventually replace all 3 splash screens. The other 2 are not as trivial as the Almost There screen.
  • 3. Installs a profile with “aliases” that provides shortcuts to commonly used commands. For example, to mount your root drive as read-write, instead of typing out the full “mount –o remount,rw /”, you simply type “rw”. See the readme for the full list of aliases installed. The script first checks to see if you have an existing profile, and then prompts you if you want to replace it. If you choose to replace it, the script backs up your existing profile in the root directory as /.profile.bak. The new profile contains the following aliases:
  • MOUNT READ WRITE = rw (instead of "mount -o remount,rw /")
  • MOUNT READ ONLY = ro (instead of "mount -o remount,ro /")
  • START TIVOWEBPLUS WITH CONSOLE = twp
  • FIND THE LOCATION OF A FILE = ffind (instead of "find / -name")
  • EDIT YOUR rc.sysinit.author FILE = author
  • EDIT YOUR CRONTAB = root
  • RESTART TWP = twprs
  • 4. Installs a Customized Version of TivoWebPlus. Includes custom icons created by TheEndless, and also several additional useful modules, including:
  • Netconfig.itcl (set IP address, mask, wireless SSID, etc in MFS): courtesy of Flash_ and lgkahn.
  • MRV.itcl courtesy of Flash_ and Alldeadhomiez.
  • Channelprefs.itcl (set/backup/restore channel preferences): courtesy of SteveT.
  • Hackman (start/stop TiVo hacks, edit start-up scripts, etc): courtesy of PortlandPaw.
  • Merge (merge multiple shows for batch play): courtesy of acacia.
  • Backup (backup/restore season passes and wishlishts): courtesy of angra and agw.
  • Manual Record: courtesy of John1980.

The script first looks for existing Tivowebplus installations in root, /var/hack/, and /var/local/ (can’t account for everything!). If an existing installation is found, it skips the new TWP installation, and creates a short script call TWPrun.sh in the /enhancements/ directory that’s used later by cron to restart TWP every night. If you choose to install TWP, it puts it in /TivoWebPlus, along with my favorite modules, all distributed with the permission of the authors. If the script installs TWP is creates the same TWPrun script, and also creates a dummy file called TWPtemp in /var/hack with a flag to tell the uninstall script to remove Tivowebplus, only if it was installed by this script. If you have TWP installed somewhere not detected by the script, you can either move the TWP folder to /var/hack/, or edit the TWPrun script to point to wherever you have it installed. You could also do nothing and cron just won’t restart TWP every night for you.

  • Note - if you update TWP after using this script, the customized name will disappear with the new version. To put the name of your Tivo back into the menus, go into
/TivoWebPlus/load.tcl

and find

 namespace eval TWP {
   variable NAME	"TivoWebPlus "

This is usually around line 55. You need to change this to your liking, e.g.

namespace eval TWP {
   variable NAME	"TivoWebPlus - Family Room"

You will need to do this each time you upgrade your TivoWebPlus

  • 5. Installs a fully functional cron setup for improved performance and logging. Creates all required directories and files, and installs a crondtab to do the following:
  • To verify cron is working properly, check out a file called /var/spool/cron/cronlogs/cron.test.out, which should have an entry created every 5 minutes if crond is reading your crontab correctly. This file gets wiped every night to keep it from getting too big. Also check out /var/spool/cron/cronlogs/CRONLOG-MAIN to see each of the activities described below being executed by crond.
  • Restarts Tivowebplus every night at 3am CST to eliminate occasional problems that crop up with TWP. I believe many of the kinks in TWP have been ironed out for 6.x/7.x installations, but if you look at the forums, whenever someone has a problem, advice is always given to restart TWP. Anyway, can’t hurt. Here’s where we use the TWPrun.sh script described earlier.
  • Creates a tarball (archive) of your logs once/week, and saves it in your root directory for easy FTP’ing. Helpful to have if something ever goes wrong with your Tivo, or you just want to explore your logs. Look for a file called LOG_ARCHIVE with the date appended to end of the filename. One file per week is created, and they all get wiped every 3 months to conserve space.
  • Wipes your logs once/week (after archiving them) to keep them from getting to big and hindering performance. Also wipes the tarball archive above.
  • Runs fakecall every night at 3am.
  • Reboots your Tivo once/week at 3am. This cleans things out for better performance if you have several hacks running. Also restarts logs, and allows fakecall to reset the last successful call indicator, so your Tivo won't call home (fakecall doesn't update mfs entries without a reboot). This allows you to keep your phone line connected for PPV ordering or CallerID. Gives you the option to use smartreboot, which only reboots if your Tivo is not recording anything.
  • Feel free to modify the crontab and customize it to your taste. It’s a file called “root”, and it’s located in var/spool/cron/crontabs/.
  • 6. Searches for and removes MRV/HMO expiration certificates from MFS. If you received your 6.2 image from a Tivo download and then hacked it using the Gunnyman guide, you most likely got theses certificates, which will stop MRV/HMO from working 180 days after the download occurred. This script is called cert-remover.tcl. You can see if you have the certificates by selecting “MFS” from the Tivowebplus main menu. Then select “State”, then “keyring”. The certificates looks something like this: SP_4-production-5-12941-180-A-13121-A-13121-A. The numbers will be slightly different on yours depending on when you downloaded your version of 6.2, but they will always start with “SP_4” or “SP_5”. If you used Alphawolf’s 62small.mfs image from Emule, you will not have the certificates.
  • 7. Makes a Backup of Your Season Passes and Wishlists. This is extremely useful if your drive ever fails, or you have to rehack your Tivo, upgrade to a new software version, or buy a new Tivo. Many thanks to agw who wrote the core tcl script that makes this feature possible. This feature is based on agw and angra’s backup.itcl module for Tivowebplus. Backups are written to /seasonpass-backups/<date>backup. Be sure to FTP the backups to your PC frequently for safe keeping. To restore a backup, use the Tivowebplus backup module. Selecting this option calls the script backup_run.tcl, which gets copied to your TWP directory after the script locates your TWP installation location. This short script creates the /seasonpass-backups directory, launches the core backup_write_static.tcl script, and finally renames the backup file so it includes the current date and time.
  • 8. Appends Your Crontab to Make a Weekly Backup of Your Season Passes and Wishlists. I always forget to make manual backups in TWP, and when I clobber one of my Tivos, I’m always restoring an outdated backup. This feature uses cron to make weekly backups and store them in /seasonpass-backups/<date>backup. Be sure to frequently FTP the backups to your PC for safe keeping.
  • 9. Updates fakecall.tcl with a Version That Works with 6.2. It also tests fakecall while the script is running to make sure it works. Fakecall is needed if you plan to keep a phone line connected for things like callerID and PPV ordering. If you don’t know what you’re doing, don’t connect a phone line, or Tivo will wipe all your hacks.
  • 10. Adds or Removes Showcases and Yellow Stars. If your Tivo is hacked, you most likely don’t get Showcases and Yellow Stars anymore. The script asks you if you want them or not, and runs one of two tcl scripts that add or remove the MFS tokens that signal Tivo go give you showcases. If you select this, showcases should start showing up the following morning.
  • 11. Updates the Profile to Easily Edit the Crontab. I added an alias to the .profile called “root” that opens up the crondtab (var/spool/cron/crontabs/root) in vi. I hated typing that whole long path every time I wanted to edit it. Just type “root” from bash to edit this file.
  • 12. Installs NCID CallerID Application. Both the client and server are installed on your Tivo. Also, you can manually configure it to run the server on one Tivo and have it communicate with multiple Tivo clients. Other options can be tweaked to your taste. See the NCID website here for details. The on-screen display program used by NDID does not work for Series 2.5 Tivos, so this feature gets skipped.
  • 13. Installs USB 2.0 Drivers. First backs up original drivers to a folder called backups-orig. Installs the correct drivers based on the kernel version of your Tivo that’s detected by the script. Thanks to Jamie and Alldeadhomiez for making this possible, and for granting permission to use the drivers here. Installs USB core and host controller drivers only, which work well with most stock drivers on the Tivo.
  • 14. Confirms network settings are appropriate for MRV. Checks to see if your IP parameters are permanently set in MFS, and if not, will set them for you if you choose. This is required for MRV to work properly.
  • 15. Installs "netperf" to measure network performance between multiple Tivos. Actually, it just configures netperf paramters in a series of aliases that let you easily test MRV speeds by typing a single word a the bash prompt.
  • 16. Installs EndPad(Plus). Many thanks to Sanderton and Falcontx for their permission to use this fantastic tool. If you like EndPad (or even if you don’t), please consider making a donation to Cancer Research though this link, posted by Stuart Anderton, the author of EndPad.
  • 17. Installs the joe Text Editor. For all who have cursed vi at one time or another, this is for you. It’s a bit more human friendly than vi.
  • 18. Customizes Your Bash Prompt. This adds a descriptor to your bash prompt, which can be especially useful if you have multiple Tivos. There’s also an option to add the “TiVo colors” to the bash prompt.
  • 19. Keeps Your Hacks Out of /var. The /var partition is the equivalent of a Windows recycle bin, and occasionally your Tivo will decide to wipe everything in there. The problem is that many hacks are hardcoded to use /var, and will not work if stored anywhere else. All such hacks installed by the enhancements script are stored in /enhancements/varhacks. The script creates symlinks in /var that point to the corresponding hacks in /enhancments/varhacks. It also appends the author file with commands to recreate the symlinks if /var ever gets wiped. If you want to move other hacks out of var, copy them to /enhancements/varhacks, and then run the script called var-symlinks.
  • 20. If you choose to install Tivowebplus or crond, the script appends your rc.sysinit.author file to start those hacks on boot up. The script back up your original rc.sysinit.author file to rc.sysinit.author.bak. The uninstall script restores the backup. There’s ton of echo and sleep commands in the script, used mostly for my troubleshooting purposes, but also gives you a chance to see exactly what’s going on. I wrote this script mainly to teach myself Linux shell scripting, and it’s the first real script I’ve ever written.