2011-07-05 18:38:42 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
2011-07-05 18:38:42 +00:00
|
|
|
|
|
|
|
set dir /mod/var/backup
|
|
|
|
|
|
|
|
puts "Content-Type: text/html"
|
2011-07-11 23:29:21 +00:00
|
|
|
puts "Pragma: no-cache"
|
2011-07-05 18:38:42 +00:00
|
|
|
puts "Expires: Thu, 01 Jan 1970 00:00:00 GMT"
|
|
|
|
puts ""
|
|
|
|
|
|
|
|
cgi_input
|
|
|
|
#cgi_dump
|
|
|
|
|
|
|
|
if {![dict exists $_cgi restore_file]} {
|
|
|
|
puts "No filename supplied."
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
set file [file tail [dict get $_cgi restore_file]]
|
2011-07-05 22:59:34 +00:00
|
|
|
set ffile "/$dir/$file.rbk"
|
2011-07-05 18:38:42 +00:00
|
|
|
|
|
|
|
if {![file exists $ffile]} {
|
|
|
|
puts "Backup file <i>$file</i> does not exist."
|
|
|
|
} elseif {[catch { file delete $ffile } msg]} {
|
|
|
|
puts "Deletion failed: $msg"
|
|
|
|
} else {
|
|
|
|
puts "Successfully deleted <i>$file</i>"
|
|
|
|
}
|
|
|
|
|