2012-09-21 20:56:53 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
|
|
|
source /mod/webif/lib/setup
|
|
|
|
|
|
|
|
require rsv.class findhsvc
|
|
|
|
|
|
|
|
set dir /mod/var/backup
|
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
httpheader
|
2012-09-21 20:56:53 +00:00
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
set file [file tail [cgi_get restore_file]]
|
|
|
|
if {$file == 0} {
|
2012-09-21 20:56:53 +00:00
|
|
|
puts "No filename supplied."
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
set ffile "/$dir/$file.rbk"
|
|
|
|
|
|
|
|
if {![file exists $ffile]} {
|
|
|
|
puts "Backup file <i>$file</i> does not exist."
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
if {[catch { set fd [open $ffile r] } msg]} {
|
|
|
|
puts "Error opening <i>$file</i> - $msg"
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
puts "Listing scheduled events from <i>$file</i>..."
|
|
|
|
|
|
|
|
set fields [lsort [[rsv] vars]]
|
|
|
|
|
|
|
|
set data [split [read $fd] "\n"]
|
|
|
|
|
|
|
|
foreach line $data {
|
|
|
|
set vals [split $line "\t"]
|
|
|
|
if {[lindex $vals 0] ne "event"} { continue }
|
|
|
|
set vars {}
|
|
|
|
set i 0
|
|
|
|
foreach f $fields {
|
|
|
|
if {$f eq "aulEventToRecordInfo"} { continue }
|
|
|
|
incr i
|
|
|
|
lappend vars $f [lindex $vals $i]
|
|
|
|
}
|
|
|
|
|
|
|
|
set rsv [rsv new $vars]
|
|
|
|
|
|
|
|
puts " [$rsv name] ([$rsv channel_name])"
|
|
|
|
}
|
|
|
|
|
|
|
|
close $fd
|
|
|
|
rsv cleanup
|
|
|
|
|