Skip to content

Commit 9948d1e

Browse files
committed
change from vcmd_exec to a method in the module
1 parent 07d78af commit 9948d1e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

modules/post/linux/manage/download_exec.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,18 @@ def initialize(info={})
4242

4343
def run
4444
if datastore['URL'].match(/https/)
45-
vcmd_exec("`which curl` -k #{datastore['URL']} 2>/dev/null | `which bash` ")
45+
cmd_exec_vprint("`which curl` -k #{datastore['URL']} 2>/dev/null | `which bash` ")
4646
else
47-
vcmd_exec("`which curl` #{datastore['URL']} 2>/dev/null | `which bash` ")
47+
cmd_exec_vprint("`which curl` #{datastore['URL']} 2>/dev/null | `which bash` ")
4848
end
4949
end
50+
51+
def cmd_exec_vprint(cmd)
52+
vprint_status("Executing: #{cmd}")
53+
output = cmd_exec(cmd)
54+
if output.length > 0
55+
vprint_status("#{output}")
56+
end
57+
return
58+
end
5059
end

0 commit comments

Comments
 (0)