Updates the progress function

Because the previous one was wrong.
bug/bundler_fix
sinn3r 2013-01-21 00:30:43 -06:00
parent 967c04e727
commit 8b70a94b34
1 changed files with 10 additions and 4 deletions

View File

@ -37,10 +37,16 @@ class Metasploit3 < Msf::Post
end end
def progress def progress
timeout = (datastore['DURATION'] < 1) ? 1 : (datastore['DURATION']*0.1) duration = datastore['DURATION']
datastore['DURATION'].times do |i| m = duration / 10
print_status("Recording: #{(Float(i+1)/datastore['DURATION'] * 100).round}% done...") m = 1 if m == 0
select(nil, nil, nil, timeout)
duration.times do |i|
if i % m == 0
p = ((Float((i == 0) ? 1 : i+1) / duration) * 100).round
print_status("#{rhost} - #{p.to_s}%...")
end
select(nil, nil, nil, 1)
end end
end end