From 6bde33f70760fd3da16c8564659595e7345faaaa Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Mon, 13 Jul 2020 19:20:34 -0700 Subject: [PATCH] remove unnecessary extra check, just check if the init file is available --- certbot-dns-dnsimple/snap/hooks/pre-refresh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/certbot-dns-dnsimple/snap/hooks/pre-refresh b/certbot-dns-dnsimple/snap/hooks/pre-refresh index 8998fecb5..bf1521d22 100644 --- a/certbot-dns-dnsimple/snap/hooks/pre-refresh +++ b/certbot-dns-dnsimple/snap/hooks/pre-refresh @@ -1,14 +1,13 @@ #!/bin/sh -e -first_install="$(snapctl get first-install)" -if [ -z "$first_install" ]; then - snapctl set first-install="false" - echo "first install, not doing any version comparison checks" >> "$SNAP_DATA/debuglog" - exit 0 -fi - echo "ls $SNAP/certbot-shared:" >> "$SNAP_DATA/debuglog" ls $SNAP/certbot-shared >> "$SNAP_DATA/debuglog" + +if [ ! -f "$SNAP/certbot-shared/__init__.py" ]; then + echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog" + exit 0 +fi + cb_installed=$(grep -oP "__version__ = '\K.*(?=')" $SNAP/certbot-shared/__init__.py) echo "cb_installed: $cb_installed" >> "$SNAP_DATA/debuglog" snapctl set cb-installed="$cb_installed"