diff options
author | Erica Portnoy <ebportnoy@gmail.com> | 2020-07-14 05:20:34 +0300 |
---|---|---|
committer | Erica Portnoy <ebportnoy@gmail.com> | 2020-07-14 05:20:34 +0300 |
commit | 6bde33f70760fd3da16c8564659595e7345faaaa (patch) | |
tree | 8996c542e9a245b04d121605eadf456af9df0dee | |
parent | 04238e050b461de72f09a64733188f8e90b4e8a7 (diff) |
remove unnecessary extra check, just check if the init file is available
-rw-r--r-- | certbot-dns-dnsimple/snap/hooks/pre-refresh | 11 |
1 files changed, 5 insertions, 6 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" +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 -echo "ls $SNAP/certbot-shared:" >> "$SNAP_DATA/debuglog" -ls $SNAP/certbot-shared >> "$SNAP_DATA/debuglog" 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" |