diff --git a/certbot-dns-dnsimple/snap/hooks/post-refresh b/certbot-dns-dnsimple/snap/hooks/post-refresh index 1c3ce8397..1a39e9bcb 100644 --- a/certbot-dns-dnsimple/snap/hooks/post-refresh +++ b/certbot-dns-dnsimple/snap/hooks/post-refresh @@ -1,7 +1,7 @@ #!/bin/sh -e # get certbot version -cb_installed=$(snap info certbot | grep -oP 'installed:\s+\K\d+.\d+.\d(?=-)') +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/snapcraft.yaml b/certbot-dns-dnsimple/snap/snapcraft.yaml index 7d7812a52..a306bb0c4 100644 --- a/certbot-dns-dnsimple/snap/snapcraft.yaml +++ b/certbot-dns-dnsimple/snap/snapcraft.yaml @@ -27,3 +27,11 @@ slots: content: certbot-1 read: - $SNAP/lib/python3.8/site-packages + +hooks: + post-refresh: + plugs: + certbot-version: + interface: content + content: version-1 + target: $SNAP/certbot-version diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 14c1fc9e7..730010934 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -90,3 +90,9 @@ plugs: interface: content content: certbot-1 target: $SNAP/certbot-plugin + +slots: + version: + interface: content + content: version-1 + read: $SNAP/bin/certbot \ No newline at end of file