From 2bbbc78e8b41e51082601a573d9c7d445cd4c734 Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Tue, 14 Jul 2020 18:29:33 -0700 Subject: [PATCH] improve bash syntax --- certbot-dns-dnsimple/snap/hooks/post-refresh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/certbot-dns-dnsimple/snap/hooks/post-refresh b/certbot-dns-dnsimple/snap/hooks/post-refresh index 38cd09efa..f03841b43 100644 --- a/certbot-dns-dnsimple/snap/hooks/post-refresh +++ b/certbot-dns-dnsimple/snap/hooks/post-refresh @@ -15,11 +15,11 @@ cb_required=$(grep -oP "certbot>=\K.*(?=')" $SNAP/setup.py) echo "cb_required: $cb_required" >> "$SNAP_DATA/debuglog" echo "cb_required: $cb_required" -python3 -c 'from distutils.version import LooseVersion;\ - exit(1) if LooseVersion("$cb_installed") < LooseVersion("$cb_required") else exit(0)' +python3 -c "from distutils.version import LooseVersion; exit(1) if LooseVersion('$cb_installed')\ + < LooseVersion('$cb_required') else exit(0)" || exit_code=$? -if [ "$?" -eq 1 ]; then - echo "Certbot is version $cb_installed but needs to be at least $cb_required before \ - this plugin can be updated; will try again on next refresh." +if [ "$exit_code" -eq 1 ]; then + echo "Certbot is version $cb_installed but needs to be at least $cb_required before" \ + "this plugin can be updated; will try again on next refresh." exit 1 fi