#!/mod/bin/jimsh

package require cgi
source /mod/webif/lib/setup
require rsv.class epg.class system.class

httpheader

set slots [cgi_get slot -]
set xservice [cgi_get service 0]
set xevent [cgi_get event 0]

if {$slots eq "-"} exit

set done 0
foreach slot [split $slots ","] {
	set event [rsv slot $slot]

	if {[catch {
		$event apply_skip $xservice $xevent
	} msg]} {
		puts "!$msg"
		break
	}
	incr done
	system restartpending
}

if {$done} { rsv commit }

