2ab6f7caa2
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1398 2a923420-c742-0410-a762-8d5b09965624
39 lines
806 B
Plaintext
Executable File
39 lines
806 B
Plaintext
Executable File
#!/mod/bin/jimsh
|
|
|
|
package require cgi
|
|
source /mod/webif/lib/setup
|
|
require epg.class system.class
|
|
|
|
httpheader
|
|
|
|
set service [cgi_get service -]
|
|
set event [cgi_get event -]
|
|
set type [cgi_get type 1]
|
|
|
|
if {$service eq "-" || $event eq "-"} {
|
|
puts "Error, insufficient parameters passed."
|
|
exit
|
|
}
|
|
|
|
set event [lindex [epg fetch dump -service $service -event $event] 0]
|
|
if {$event eq ""} {
|
|
puts "Error, cannot find event to schedule."
|
|
exit
|
|
}
|
|
if {[$event percent] > 0} {
|
|
puts "Error, cannot record programme which has already started showing"
|
|
puts "or occurred in the past."
|
|
exit
|
|
}
|
|
|
|
set r [rsv construct $event $type]
|
|
if {[catch {$r insert} msg]} {
|
|
puts "Error encountered while scheduling: <i>$msg</i>"
|
|
} else {
|
|
puts "Successfully scheduled <i>[$event get name]</i>"
|
|
system restartpending
|
|
}
|
|
|
|
epg cleanup
|
|
|