From 40662d234e1d01532664ac16d41c7821493c8490 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Tue, 29 Aug 2023 11:20:03 +0100 Subject: [PATCH] Abort if bouncer version can't be fetched. --- root/etc/s6-overlay/s6-rc.d/init-mod-swag-crowdsec/run | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-swag-crowdsec/run b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-crowdsec/run index 3a75187..91fec89 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-swag-crowdsec/run +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-crowdsec/run @@ -32,6 +32,11 @@ if [[ -z ${CROWDSEC_VERSION+x} ]]; then \ CROWDSEC_VERSION=$(curl -s "https://api.github.com/repos/crowdsecurity/cs-nginx-bouncer/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]'); fi +if [[ -z ${CROWDSEC_VERSION+x} ]]; then \ + echo "**** Could not fetch current bouncer version from Github ****" + exit 1 +fi + curl "${CURL_NOISE_LEVEL}" -Lo \ /tmp/crowdsec.tar.gz -L \ "https://github.com/crowdsecurity/cs-nginx-bouncer/releases/download/${CROWDSEC_VERSION}/crowdsec-nginx-bouncer.tgz"