webif/webif/lib/bin/strip-update

32 lines
513 B
Plaintext
Executable File

#!/mod/bin/jimsh
source /mod/webif/lib/setup
require system.class ts.class
ts iterate [lambda {ts} {
#puts " [$ts get file]"
if {[$ts flag "Shrunk"]} { return }
set file [file rootname [$ts get file]]
if {[$ts inuse]} { return }
if {[catch {
set perc [exec /mod/bin/stripts -aq $file]
} msg]} {
return
}
if {[string match {*%} $perc]} {
set perc [string range $perc 0 end-1]
} else {
set perc 0
}
if {$perc == 0} {
puts " Flagging $file as shrunk..."
$ts set_shrunk
}
}] 1