#!/tvbin/tivosh # I have used this script to change the IR base of a TIVO-SA-I NTSC version 3.0, which runs in PAL mode, # h o w e v e r , no liability, no support, nothing if it breaks! # dbsX (dbset extended) can set list values and/or can work in interactive mode # (will display then ask for value, no change if enter only) # based on dbset and TIVOir, thanks! # Sample usage: # ========== # dbsetX /Setup #no attribute: just dumps the object so the attributes are displayed # dbsetX /Setup CableType 3 # will set CableType to 3 (like dbset does) # dbsetX /Setup CableType # will ask for value of cable type, after displaying # dbsetX /Component/Ir/Format/1 Option 0 "4 148" # will set Option to listvalue 0 4 148 # dbsetX 785/11 Option - "4 148" # note the - will ask 'first' value then set format to first 4 148 # General usage: # dbsetX databse-ref attribute-name-to-set value-or-none-for-interactive-mode added-values-after-first-if-list # database-ref can be an object name such as /Component/Ir/TivoFormat/10001 # or can be an object-ID such as 785/11 or 785 # source $tcl_library/tv/log.tcl proc OpenObject {db objspec} { set dumpId $objspec if {[string range $objspec 0 0] == "/"} { set obj [db $db open $objspec] } elseif { [regexp {([0-9]*)/(.*)} $objspec junk fsid subobjid] } { set obj [db $db openidconstruction $fsid $subobjid] set dumpId $fsid } else { set obj [db $db openid $objspec] } return $obj } set obj [lindex $argv 0] set attr [lindex $argv 1] set val [lindex $argv 2] set addVal [lindex $argv 3] set dumpId 1 set db [dbopen] RetryTransaction { set x [OpenObject $db $obj] if {$attr != ""} { set valNow [dbobj $x get $attr] # if no val given, ask it, else display current value if {$val == "" || $val == "-"} { puts "$obj $attr: $valNow New value (first only):" gets stdin val } else { puts "$obj $attr val was: $valNow" } # if no value given, dont change else change first value if { "$val" != ""} { dbobj $x set $attr $val # if list of values given, change then also if { "$addVal" != ""} { foreach item $addVal { dbobj $x add $attr $item } } set valNow [dbobj $x get $attr] puts "$obj $attr set to : $valNow" } else { puts "No change" } ; #enif test value given } ; #endif test attrib given } ; #indif transaction if {$attr == ""} {dumpobj $obj} ;# if no attrib just dump the object