diff options
author | Erica Portnoy <ebportnoy@gmail.com> | 2020-07-14 05:26:43 +0300 |
---|---|---|
committer | Erica Portnoy <ebportnoy@gmail.com> | 2020-07-14 05:26:43 +0300 |
commit | 4cc0390b38f7942e15688dd547229dc23bd4805b (patch) | |
tree | 785998f8e4e472ecb7316e020af916798a1161c5 | |
parent | 6bde33f70760fd3da16c8564659595e7345faaaa (diff) |
check if certbot version will be available post-refresh after all
-rw-r--r-- | certbot-dns-dnsimple/snap/hooks/post-refresh | 12 | ||||
-rw-r--r-- | certbot-dns-dnsimple/snap/hooks/pre-refresh | 18 |
2 files changed, 18 insertions, 12 deletions
diff --git a/certbot-dns-dnsimple/snap/hooks/post-refresh b/certbot-dns-dnsimple/snap/hooks/post-refresh index 6dbf99b56..301179e73 100644 --- a/certbot-dns-dnsimple/snap/hooks/post-refresh +++ b/certbot-dns-dnsimple/snap/hooks/post-refresh @@ -1,13 +1,19 @@ #!/bin/sh -e # get certbot version -cb_installed="$(snapctl get cb-installed)" +# cb_installed="$(snapctl get cb-installed)" -if [ -z "$cb_installed" ]; then - echo "cb_installed not set, not doing version comparison check" >> "$SNAP_DATA/debuglog" +# if [ -z "$cb_installed" ]; then +# echo "cb_installed not set, not doing version comparison check" >> "$SNAP_DATA/debuglog" +# exit 0 +# fi + +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" # get required certbot version for plugin diff --git a/certbot-dns-dnsimple/snap/hooks/pre-refresh b/certbot-dns-dnsimple/snap/hooks/pre-refresh index bf1521d22..ea9092ca0 100644 --- a/certbot-dns-dnsimple/snap/hooks/pre-refresh +++ b/certbot-dns-dnsimple/snap/hooks/pre-refresh @@ -1,13 +1,13 @@ #!/bin/sh -e -echo "ls $SNAP/certbot-shared:" >> "$SNAP_DATA/debuglog" -ls $SNAP/certbot-shared >> "$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 +# 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" +# 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" |