summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2015-06-26 09:28:16 +0100
committerThom May <thom@may.lt>2015-06-26 09:28:16 +0100
commit7fd7d2f166ecf44d5b7214cef03fca08b5fc1685 (patch)
tree409c0670c95eedff6da886555ec6fa4642141e51
parent769d3f5b38e07e49d5df9bb067168e1efacdd7e4 (diff)
parent65f7e4648b04dd403ffabed4eeb4847dc865f34c (diff)
downloadchef-7fd7d2f166ecf44d5b7214cef03fca08b5fc1685.tar.gz
Merge pull request #3589 from chef/tm/fix_bashisms
Fix some errant bashisms
-rw-r--r--lib/chef/knife/bootstrap/templates/chef-full.erb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/knife/bootstrap/templates/chef-full.erb b/lib/chef/knife/bootstrap/templates/chef-full.erb
index 335b1f181c..b0d7a6e05d 100644
--- a/lib/chef/knife/bootstrap/templates/chef-full.erb
+++ b/lib/chef/knife/bootstrap/templates/chef-full.erb
@@ -12,7 +12,7 @@ tmp_dir="$tmp/install.sh.$$"
(umask 077 && mkdir $tmp_dir) || exit 1
exists() {
- if command -v $1 &>/dev/null
+ if command -v $1 >/dev/null 2>&1
then
return 0
else
@@ -166,12 +166,12 @@ do_download() {
<%= knife_config[:bootstrap_install_command] %>
<% else %>
install_sh="<%= knife_config[:bootstrap_url] ? knife_config[:bootstrap_url] : "https://www.opscode.com/chef/install.sh" %>"
- if ! exists /usr/bin/chef-client; then
+ if test -f /usr/bin/chef-client; then
+ echo "-----> Existing Chef installation detected"
+ else
echo "-----> Installing Chef Omnibus (<%= latest_current_chef_version_string %>)"
do_download ${install_sh} $tmp_dir/install.sh
sh $tmp_dir/install.sh -P chef <%= latest_current_chef_version_string %>
- else
- echo "-----> Existing Chef installation detected"
fi
<% end %>