1
mirror of https://github.com/rapid7/metasploit-framework synced 2024-10-29 18:07:27 +01:00

Deal with wait more sensibly

This commit is contained in:
Tod Beardsley 2012-10-01 12:41:36 -05:00
parent 2b44cd0322
commit ee4c6bb976

View File

@ -23,14 +23,20 @@ if not (Process.uid == 0 or File.stat(msfbase).owned?)
$stderr.puts "Please run msfupdate as the same user who installed metasploit."
end
wait = (@args.shift.to_s == "wait")
have_configdir = false
@args.each do |arg|
wait_index = nil
@args.each_with_index do |arg,i|
if arg == "wait"
wait_index = i
end
next unless arg =~ /--config-dir/
have_configdir = true
end
if wait_index
@args.delete_at wait_index
end
unless have_configdir
configdir = File.join(File.dirname(msfbase), "data", "svn")
# Spaces in the directory should be fine since this whole thing is passed
@ -49,11 +55,10 @@ if res.nil?
$stderr.puts "[-] to ensure a proper environment."
else
# Cleanup worked, go ahead and update
$stderr.puts "DEBUG: Going with *@args: #{@args.inspect}"
system("svn", "update", *@args)
end
if wait
if wait_index
$stderr.puts ""
$stderr.puts "[*] Please hit enter to exit"
$stderr.puts ""