From 4e84679360e9a8d8db5ee412869c2930524c5af2 Mon Sep 17 00:00:00 2001 From: AltMeta Date: Wed, 29 Mar 2017 16:10:08 +0100 Subject: [PATCH 1/2] added the ability to download Ignition config --- bin/coreos-install | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/coreos-install b/bin/coreos-install index 4614cb3..4c925ac 100755 --- a/bin/coreos-install +++ b/bin/coreos-install @@ -344,10 +344,20 @@ if [[ -n "${CLOUDINIT}" ]]; then fi if [[ -n "${IGNITION}" ]]; then + + if [[ "${IGNITION:4:3}" == "://" ]]; then + if ! wget --quiet "${IGNITION}" -O "/tmp/coreos-install.json"; then + echo "$0: Failed to download Ignition config file (${IGNITION})" >&2 + exit 1 + fi + IGNITION="/tmp/coreos-install.json" + fi + if [[ ! -f "${IGNITION}" ]]; then echo "$0: Ignition config file (${IGNITION}) does not exist." >&2 exit 1 fi + fi if [[ -n "${OEM_ID}" ]]; then From f1064db4becdb6285886d58606d6c67b02459ccd Mon Sep 17 00:00:00 2001 From: AltMeta Date: Thu, 30 Mar 2017 10:18:11 +0100 Subject: [PATCH 2/2] only matches when starts with http or https --- bin/coreos-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/coreos-install b/bin/coreos-install index 4c925ac..bf1cf4f 100755 --- a/bin/coreos-install +++ b/bin/coreos-install @@ -345,7 +345,7 @@ fi if [[ -n "${IGNITION}" ]]; then - if [[ "${IGNITION:4:3}" == "://" ]]; then + if [[ "${IGNITION}" =~ ^https?:// ]]; then if ! wget --quiet "${IGNITION}" -O "/tmp/coreos-install.json"; then echo "$0: Failed to download Ignition config file (${IGNITION})" >&2 exit 1