#!/tvbin/tivosh

setpri fifo 1

lappend auto_path $tcl_library/tv

source $tcl_library/tv/Inc.itcl
tvsource $tcl_library/tv/EndPoint.itcl
tvsource $tcl_library/tv/Ident.itcl
tvsource $tcl_library/tv/SwSystem.itcl
tvsource $tcl_library/tv/Database.itcl
tvsource $tcl_library/tv/SvrResp.itcl
tvsource $tcl_library/tv/mfslib.tcl
tvsource $tcl_library/tv/LogMgr.itcl
tvsource $tcl_library/tv/Setup.itcl
tvsource $tcl_library/tv/DataSet.itcl

# supports time set
tvsource $tcl_library/tv/CmdStr.itcl 

namespace import Inc::*

set file [lindex $argv 0]
set id [lindex $argv 1]

set db [dbopen]
dbload $db $file
if { [llength $id] > 0 } {
   dumpobj /Server/$id
}

# update the clock to prevent "clock is warped" message from stopping index
# /bin/ntpdate -b 204.176.49.10 240.176.49.11

set cmdStr [CmdStr cms#auto]

# update the time to prevent "clock is warped" messages from
# stopping the index of the new guide data
$cmdStr setCmd "/bin/ntpdate -u -b -p 1 127.0.0.1"
$cmdStr process foo

# Tell MyWorld that there is new program data.
event send $TmkEvent::EVT_DATA_CHANGED $TmkDataChanged::PROGRAM_GUIDE 0


