git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3510 2a923420-c742-0410-a762-8d5b09965624
48 lines
984 B
Plaintext
Executable File
48 lines
984 B
Plaintext
Executable File
|
|
proc ::decrypt::ts {ts} {
|
|
set file [$ts get file]
|
|
|
|
if {![$ts flag "ODEncrypted"]} {
|
|
::auto::log " $file - Already decrypted." 2
|
|
return
|
|
}
|
|
|
|
if {[queue check $ts decrypt]} {
|
|
::auto::log " $file - Already queued." 2
|
|
return
|
|
}
|
|
|
|
if {[::auto::inuse $ts]} {
|
|
::auto::log " $file - In use." 2
|
|
return
|
|
}
|
|
|
|
# Check that the file is not already decrypted by analysing it.
|
|
set anencd [exec /mod/bin/stripts -qE [file rootname $file]]
|
|
if {$anencd != "1"} {
|
|
::auto::log " $file - already decrypted but the HMT flag is wrong." 0
|
|
# Fix...
|
|
exec /mod/webif/lib/bin/fixencflags $file
|
|
return
|
|
}
|
|
|
|
# Enqueue file
|
|
queue insert $ts decrypt
|
|
::auto::log " $file - Queued for decryption." 0
|
|
}
|
|
|
|
proc ::decrypt::directory {dir} {
|
|
::auto::direntries $dir ::decrypt::ts
|
|
}
|
|
|
|
proc ::decrypt::rundir {dir} {
|
|
::auto::flagscan $dir decrypt ::decrypt::directory 0
|
|
}
|
|
|
|
proc ::decrypt::run {} {
|
|
::auto::flagscan $::auto::root decrypt ::decrypt::directory
|
|
}
|
|
|
|
::auto::register decrypt 600
|
|
|