2011-06-22 23:36:30 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
|
|
|
require ts.class
|
2011-06-22 23:36:30 +00:00
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
httpheader
|
2011-06-22 23:36:30 +00:00
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
set file [cgi_get file ""]
|
2011-06-22 23:36:30 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|