Fixed commands reference bug

This commit is contained in:
codingo
2019-01-06 14:29:52 +10:00
parent 2fc5c27fb0
commit 632d59d0da
2 changed files with 29 additions and 5 deletions

View File

@@ -53,13 +53,17 @@ class InputHelper(object):
for target in targets:
# replace flags
print("[DEBUG] ............................................")
print("[DEBUG] Commend length: %s" % len(commands))
for command in commands:
command = command.replace("_target_", target)
command = command.replace("_output_", arguments.output)
command = command.replace("_port_", arguments.port)
command = command.replace("_realport_", arguments.realport)
command = str(command).replace("_target_", target)
if arguments.output:
command = str(command).replace("_output_", arguments.output)
if arguments.port:
command = str(command).replace("_port_", arguments.port)
if arguments.realport:
command = str(command).replace("_realport_", arguments.realport)
final_commands.add(command)
print("[DEBUG] Added final command %s" % command)
print("[DEBUG] Added final command %s" % str(command))
return final_commands

20
output.txt Normal file
View File

@@ -0,0 +1,20 @@
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
PING 10.0.0.4 (10.0.0.4) 56(84) bytes of data.
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
--- 10.0.0.1 ping statistics ---
70 packets transmitted, 0 received, 100% packet loss, time 728ms
--- 10.0.0.4 ping statistics ---
70 packets transmitted, 0 received, 100% packet loss, time 728ms
--- 10.0.0.3 ping statistics ---
70 packets transmitted, 0 received, 100% packet loss, time 728ms
--- 10.0.0.2 ping statistics ---
70 packets transmitted, 0 received, 100% packet loss, time 728ms