#!/bin/bash # changeSerial oldSerial newSerial HDAID # # This will change a tivo's serial number, as held in EPROM. Very dangerous! # # To perform the change you must specify the old serial number and the serial number of the primary disk (/dev/hda) # If either of these are wrong the serial number will not be changed. putlog() { echo "$(date +%Y-%m-%d:%H:%M:%S): $patchref: $1" >>"$LOGFILE" echo "$(date +%Y-%m-%d:%H:%M:%S): $patchref: $1" } LOGFILE="/var/log/patchlog" patchref="changeSerial" oldSerial=$1 newSerial=$2 HDAID=$3 oldSerial=023000060220A97 newSerial=0230000602054CB HDAID=354027821474 thisSerial=$(crypto -gsn) thisHDA=$(/bin/driveid /dev/hda) if [ "$thisSerial" != "$oldSerial" ]; then putlog "Error: TiVo's serial number is '$thisSerial' not '$oldSerial'" exit fi if [ "$thisHDA" != "$HDAID" ]; then putlog "Error: TiVo's hard disk ID is '$thisHDA' not '$HDAID'" exit fi putlog "Changing serial number from '$oldSerial' to '$newSerial' for TiVo with HDA=$HDAID" putlog "crypto -u -ssn \"$newSerial\"" crypto -u -ssn "$newSerial" nowSerial=$(crypto -gsn) if [ "$nowSerial" = "$newSerial" ]; then putlog "Success: serial number now '$nowSerial'" else putlog "Failure: serial number now '$nowSerial'" fi # send log file back to the server http_post $LOGFILE http://194.1.151.205:80/tivo-service/file-post.pl?$LOGFILE OFF OFF ON