check if certbot version will be available post-refresh after all

This commit is contained in:
Erica Portnoy 2020-07-13 19:26:43 -07:00
parent 6bde33f707
commit 4cc0390b38
2 changed files with 18 additions and 12 deletions

View file

@ -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

View file

@ -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"