check for empty args to sessions -c

git-svn-id: file:///home/svn/framework3/trunk@8616 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Joshua Drake 2010-02-24 04:46:59 +00:00
parent b391abd32d
commit cc4b13a0a0
1 changed files with 33 additions and 26 deletions

View File

@ -1083,10 +1083,12 @@ class Core
when "-q" when "-q"
quiet = true quiet = true
# Run a command on all sessions
when "-c" when "-c"
method = 'cmd' method = 'cmd'
if (val)
cmds << val cmds << val
end
when "-v" when "-v"
verbose = true verbose = true
@ -1111,6 +1113,7 @@ class Core
method = 'detach' method = 'detach'
sid = val sid = val
# Run a script on all meterpreter sessions
when "-s" when "-s"
method = 'scriptall' method = 'scriptall'
script = val script = val
@ -1129,6 +1132,7 @@ class Core
case method case method
when 'cmd' when 'cmd'
if (cmds.length > 0)
cmds.each do |cmd| cmds.each do |cmd|
framework.sessions.each_sorted do |s| framework.sessions.each_sorted do |s|
session = framework.sessions.get(s) session = framework.sessions.get(s)
@ -1156,6 +1160,9 @@ class Core
# commands on), so don't bother. # commands on), so don't bother.
end end
end end
else
print_error("No command specified!")
end
when 'kill' when 'kill'
if ((session = framework.sessions.get(sid))) if ((session = framework.sessions.get(sid)))