diff --git a/certbot-dns-dnsimple/snap/hooks/post-refresh b/certbot-dns-dnsimple/snap/hooks/post-refresh index 220571c36..8947c96bb 100644 --- a/certbot-dns-dnsimple/snap/hooks/post-refresh +++ b/certbot-dns-dnsimple/snap/hooks/post-refresh @@ -1,15 +1,12 @@ #!/bin/sh -e -first_install="$(snapctl get first-install)" -if [ -z "$first_install" ]; then - snapctl set first-install="false" +# get certbot version +cb_installed="$(snapctl get cb-installed)" + +if [ -z "$cb_installed" ]; then exit 0 fi -ls $SNAP/certbot-version - -# get certbot version -cb_installed=$(grep -oP 'installed:\s+\K\d+.\d+.\d(?=-)' $SNAP/certbot-version/certbot) # get required certbot version for plugin cb_required=$(grep -oP "certbot>=\K.*(?=')" $SNAP/setup.py) diff --git a/certbot-dns-dnsimple/snap/hooks/pre-refresh b/certbot-dns-dnsimple/snap/hooks/pre-refresh new file mode 100644 index 000000000..dc2ade12c --- /dev/null +++ b/certbot-dns-dnsimple/snap/hooks/pre-refresh @@ -0,0 +1,11 @@ +#!/bin/sh -e + +first_install="$(snapctl get first-install)" +if [ -z "$first_install" ]; then + snapctl set first-install="false" + exit 0 +fi + +cb_installed=$(grep -oP "__requires__ = 'certbot==\K.*(?=')" $SNAP/certbot-version/certbot) +echo "cb_installed $cb_installed" +snapctl set cb-installed="$cb_installed"