New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wget support for post/linux/manage/download_exec #1622
Conversation
end | ||
|
||
if datastore['URL'].match(/https/) | ||
cmd_exec_vprint("`which curl` -k #{datastore['URL']} 2>/dev/null | `which bash` ") | ||
cmd_exec_vprint("`which #{http_client}` #{stdout_option} #{ssl_option} #{datastore['URL']} 2>/dev/null | `which bash` ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why bash is preferred vs plain old sh? As far as I can tell, looking for bash just reduces your success rate, for instance a busybox-based embedded device doesn't have bash, but it does have sh. ESXi is also a good example, the only shell on there (also busybox-based) is ash, to which /bin/sh is linked iirc.
Hi @dougsko, Thanks for the addition, I've added pull request to your branch for cleanup Feel free to review, test and discuss anything, once you feel comfortable with changes, merge it into your repo and this pull request will be automatically updated :) Test after changes:
|
@kernelsmith , the original pull request by @jasbro ( #1596 ) was using bash, since it's included normally in linux distributions, and at lot of them sh points to bash indeed, it was fine for me. Really was not having into account embedded devices point of view, which is true normally use sh I guess because is "smaller" than bash. On the other hand I ask myself how many embedded devices have curl and/or wget available.... Still I dont have a strong opinion about using bash or sh here... are there more opinions about the topic? @jasbro, do you have something more to say here? @kernelsmith thanks for pointing the topic! Nice discussion :) |
BusyBox does, indeed, ship with wget, and does not ship with bash. Check it: http://www.busybox.net/live_bbox/live_bbox.html So 👍 for sh over bash. |
I think we should use bash if it exists and if not, drop to sh.
|
cleanup for download_exec
Oka! Let me merge this at this moment, since bash vs sh is not related to this pull request, and I'm going to open a new pull request which will switch to sh if bash isn't available :) Will be referencing this PR in the new PR. Thanks @dougsko for PR and merging changes! Merging it! |
def initialize(info={}) | ||
super( update_info( info, | ||
'Name' => 'Linux Download Exec', | ||
'Name' => 'Linux Manage Download and Exececute', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Execute
btw, @todb-r7 , I guess busybox is configurable, so the number of binaries/components changes from embedded device to embedded device |
The module looks for wget in $PATH if curl isn't found.