diff --git a/lib/msf/ui/console/driver.rb b/lib/msf/ui/console/driver.rb index 00547a5aed..eac24a576d 100644 --- a/lib/msf/ui/console/driver.rb +++ b/lib/msf/ui/console/driver.rb @@ -251,8 +251,8 @@ class Driver < Msf::Ui::Driver end # Process any additional startup commands - if opts['SCommands'] and opts['SCommands'].kind_of? Array - opts['SCommands'].each { |c| + if opts['XCommands'] and opts['XCommands'].kind_of? Array + opts['XCommands'].each { |c| run_single(c) } end diff --git a/msfconsole b/msfconsole index 17296a4c30..ea8add619e 100755 --- a/msfconsole +++ b/msfconsole @@ -101,9 +101,9 @@ class OptsConsole options['DisableBanner'] = true end - opts.on("-s", "-s ", "Execute the specified string as console commands") do |s| - options['SCommands'] ||= [] - options['SCommands'] += s.split('\n') + opts.on("-x", "-x ", "Execute the specified string as console commands (use ; for multiples)") do |s| + options['XCommands'] ||= [] + options['XCommands'] += s.split(/\s*;\s*/) end opts.separator ""