scripts will now handle # for comments and empty lines in lists and resource files
git-svn-id: file:///home/svn/framework3/trunk@11339 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
e92c073c22
commit
78a62d33c5
|
@ -82,6 +82,8 @@ if client.platform =~ /win32|win64/
|
|||
else
|
||||
backuphosts(session,hosts)
|
||||
::File.open(val, "r").each_line do |line|
|
||||
next if line.strip.length < 1
|
||||
next if line[0,1] == "#"
|
||||
add2hosts(session,line.chomp,hosts)
|
||||
end
|
||||
cleardnscach(session)
|
||||
|
|
|
@ -26,6 +26,8 @@ def list_con_exec(cmdlst)
|
|||
print_status("Running Command List ...")
|
||||
cmdout = ""
|
||||
cmdlst.each do |cmd|
|
||||
next if cmd.strip.length < 1
|
||||
next if cmd[0,1] == "#"
|
||||
begin
|
||||
print_status "\tRunning command #{cmd}"
|
||||
@client.console.run_single(cmd)
|
||||
|
|
|
@ -28,6 +28,8 @@ def list_exec(session,cmdlst)
|
|||
r=''
|
||||
session.response_timeout=120
|
||||
cmdlst.each do |cmd|
|
||||
next if cmd.strip.length < 1
|
||||
next if cmd[0,1] == "#"
|
||||
begin
|
||||
print_status "\trunning command #{cmd}"
|
||||
tmpout = "\n"
|
||||
|
|
|
@ -158,6 +158,8 @@ end
|
|||
if client.platform =~ /win32|win64/
|
||||
if resource
|
||||
resource.each do |r|
|
||||
next if r.strip.length < 1
|
||||
next if r[0,1] == "#"
|
||||
print_status("Dumping memory for #{r.chomp}") if not query
|
||||
pids = find_pids(r.chomp)
|
||||
if pids.length == 0
|
||||
|
|
|
@ -39,8 +39,12 @@ end
|
|||
def abuse(session,targets,commands,username,password,delay)
|
||||
#for each target
|
||||
targets.each do |t|
|
||||
next if t.strip.length < 1
|
||||
next if t[0,1] == "#"
|
||||
#for eacg command
|
||||
commands.each do |c|
|
||||
next if c.strip.length < 1
|
||||
next if c[0,1] == "#"
|
||||
taskname = "syscheck#{rand(100)}"
|
||||
success = false
|
||||
#check if user name and password where given, if not credential of running process used
|
||||
|
|
|
@ -104,6 +104,8 @@ end
|
|||
raise "Command List File does not exists!"
|
||||
else
|
||||
::File.open(script, "r").each_line do |line|
|
||||
next if line.strip.length < 1
|
||||
next if line[0,1] == "#"
|
||||
commands << line.chomp
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue