diff --git a/certbot-dns-dnsimple/snap/hooks/post-refresh b/certbot-dns-dnsimple/snap/hooks/post-refresh index 1b48f6b34..8947c96bb 100644 --- a/certbot-dns-dnsimple/snap/hooks/post-refresh +++ b/certbot-dns-dnsimple/snap/hooks/post-refresh @@ -1,20 +1,16 @@ #!/bin/sh -e -cb_version="$(snapctl get internal-certbot-version)" - -echo "post cb_version $cb_version" - # get certbot version -# cb_installed="$(snapctl get cb-installed)" +cb_installed="$(snapctl get cb-installed)" -# if [ -z "$cb_installed" ]; then -# exit 0 -# fi +if [ -z "$cb_installed" ]; then + exit 0 +fi -# # get required certbot version for plugin -# cb_required=$(grep -oP "certbot>=\K.*(?=')" $SNAP/setup.py) +# get required certbot version for plugin +cb_required=$(grep -oP "certbot>=\K.*(?=')" $SNAP/setup.py) -# if [ "$cb_installed" -lt "$cb_required" ]; then -# echo "Certbot needs to be updated before this plugin can be updated; will try again on next refresh." -# exit 1 -# fi +if [ "$cb_installed" -lt "$cb_required" ]; then + echo "Certbot needs to be updated before this plugin can be updated; will try again on next refresh." + exit 1 +fi diff --git a/certbot-dns-dnsimple/snap/hooks/pre-refresh b/certbot-dns-dnsimple/snap/hooks/pre-refresh index 019a51447..b3a4797d3 100644 --- a/certbot-dns-dnsimple/snap/hooks/pre-refresh +++ b/certbot-dns-dnsimple/snap/hooks/pre-refresh @@ -1,16 +1,11 @@ #!/bin/sh -e -cb_version="$(snapctl get :certbot certbot-version)" -snapctl set internal-cb-version=$cb_version +first_install="$(snapctl get first-install)" +if [ -z "$first_install" ]; then + snapctl set first-install="false" + exit 0 +fi -echo "pre cb_version $cb_version" - -# 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-exec) -# echo "cb_installed $cb_installed" -# snapctl set cb-installed="$cb_installed" +cb_installed=$(grep -oP "__requires__ = 'certbot==\K.*(?=')" $SNAP/certbot-exec) +echo "cb_installed $cb_installed" +snapctl set cb-installed="$cb_installed" diff --git a/snap/hooks/prepare-plug-plugin b/snap/hooks/prepare-plug-plugin index 075bdad17..ee309addf 100644 --- a/snap/hooks/prepare-plug-plugin +++ b/snap/hooks/prepare-plug-plugin @@ -3,7 +3,6 @@ if [ "$(snapctl get trust-plugin-with-root)" = "ok" ]; then # allow the connection, but reset config to allow for other slots to go through this auth flow snapctl unset trust-plugin-with-root - snapctl set :plugin certbot-version="test1" exit 0 else echo "Only connect this interface if you trust the plugin author to have root on the system"