From c712bc49c3c5917c4b4c2148037d9ca760f839bb Mon Sep 17 00:00:00 2001 From: "Robert L. Carpenter" Date: Sun, 23 Feb 2014 00:54:51 -0700 Subject: [PATCH 1/3] explicitly execute bash script in bash --- lib/knife-solo/bootstraps.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/knife-solo/bootstraps.rb b/lib/knife-solo/bootstraps.rb index 0cb43c7c..f3cbcd02 100644 --- a/lib/knife-solo/bootstraps.rb +++ b/lib/knife-solo/bootstraps.rb @@ -62,11 +62,7 @@ def gem_packages def http_client_get_url(url, file) stream_command <<-BASH - if command -v curl >/dev/null 2>&1; then - curl -L -o #{file} #{url} - else - wget -O #{file} #{url} - fi + /bin/bash -c "if command -v curl >/dev/null 2>&1; then curl -L -o '#{file}' '#{url}'; else wget -O '#{file}' '#{url}'; fi" BASH end From 425138ce7d235362c165fac20b648ef0aad0c01b Mon Sep 17 00:00:00 2001 From: "Robert L. Carpenter" Date: Sun, 23 Feb 2014 00:59:35 -0700 Subject: [PATCH 2/3] point at /bin/sh instead of /bin/bash opscode install.sh already depends on /bin/sh --- lib/knife-solo/bootstraps.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/knife-solo/bootstraps.rb b/lib/knife-solo/bootstraps.rb index f3cbcd02..f917eaf5 100644 --- a/lib/knife-solo/bootstraps.rb +++ b/lib/knife-solo/bootstraps.rb @@ -62,7 +62,7 @@ def gem_packages def http_client_get_url(url, file) stream_command <<-BASH - /bin/bash -c "if command -v curl >/dev/null 2>&1; then curl -L -o '#{file}' '#{url}'; else wget -O '#{file}' '#{url}'; fi" + /bin/sh -c "if command -v curl >/dev/null 2>&1; then curl -L -o '#{file}' '#{url}'; else wget -O '#{file}' '#{url}'; fi" BASH end From 9131f46b3b7d5b9e43c5989df41d2d86dacd18dc Mon Sep 17 00:00:00 2001 From: "Robert L. Carpenter" Date: Sun, 23 Feb 2014 09:23:48 -0700 Subject: [PATCH 3/3] backslashes over newlines... --- lib/knife-solo/bootstraps.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/knife-solo/bootstraps.rb b/lib/knife-solo/bootstraps.rb index f917eaf5..92a07906 100644 --- a/lib/knife-solo/bootstraps.rb +++ b/lib/knife-solo/bootstraps.rb @@ -62,7 +62,13 @@ def gem_packages def http_client_get_url(url, file) stream_command <<-BASH - /bin/sh -c "if command -v curl >/dev/null 2>&1; then curl -L -o '#{file}' '#{url}'; else wget -O '#{file}' '#{url}'; fi" + /bin/sh -c " \ + if command -v curl >/dev/null 2>&1; then \ + curl -L -o '#{file}' '#{url}'; \ + else \ + wget -O '#{file}' '#{url}'; \ + fi; \ + " BASH end