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
|
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
httpheader
|
2011-07-05 18:38:42 +00:00
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
set file [file tail [cgi_get restore_file]]
|
|
|
|
if {$file == 0} {
|
2011-07-05 18:38:42 +00:00
|
|
|
puts "No filename supplied."
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
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>"
|
|
|
|
}
|
|
|
|
|