2011-06-22 23:36:30 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
|
|
|
source /mod/var/mongoose/lib/ts.class
|
|
|
|
|
|
|
|
puts "Content-Type: text/html"
|
|
|
|
puts ""
|
|
|
|
|
|
|
|
cgi_input
|
|
|
|
#cgi_dump
|
|
|
|
|
2011-06-27 19:57:32 +00:00
|
|
|
#set _cgi(file) "/media/My Video/The Walking Dead/The Walking Dead S01E06.ts"
|
2011-06-26 23:05:38 +00:00
|
|
|
|
2011-06-22 23:36:30 +00:00
|
|
|
set file [dict get $_cgi file]
|
|
|
|
set ts [ts fetch $file]
|
2011-06-26 23:05:38 +00:00
|
|
|
if {[set ts [ts fetch $file]] != 0} {
|
|
|
|
set action lock
|
|
|
|
if {[$ts flag "Locked"]} { set action unlock }
|
2011-06-22 23:36:30 +00:00
|
|
|
|
2011-06-26 23:05:38 +00:00
|
|
|
if {[$ts $action]} {
|
|
|
|
puts "Successfully [set action]ed $file."
|
|
|
|
} else {
|
|
|
|
puts "Problem [set action]ing $file,
|
|
|
|
[$ts get error]"
|
|
|
|
}
|
2011-06-22 23:36:30 +00:00
|
|
|
}
|
|
|
|
|