Skip to content

Commit 6e257d5

Browse files
Royce DavisRoyce Davis
authored andcommitted
Simplify main method
1 parent 22ecd6a commit 6e257d5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

modules/auxiliary/admin/smb/command.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ def run_host(ip)
7474

7575
if execute_command(smbshare, ip, cmd, text, bat)
7676
get_output(smbshare, ip, text)
77-
else
78-
cleanup_after(smbshare, ip, cmd, text, bat)
79-
return
8077
end
8178
cleanup_after(smbshare, ip, cmd, text, bat)
8279
end
@@ -91,10 +88,10 @@ def execute_command(smbshare, ip, cmd, text, bat)
9188
simple.connect(smbshare)
9289
print_status("Executing your command on host: #{ip}")
9390
psexec(smbshare, execute)
94-
return True
91+
return true
9592
rescue StandardError => execerror
9693
print_error("#{ip} - Unable to execute specified command: #{execerror}")
97-
return False
94+
return false
9895
end
9996
end
10097

0 commit comments

Comments
 (0)