remove unnecessary extra check, just check if the init file is available

This commit is contained in:
Erica Portnoy 2020-07-13 19:20:34 -07:00
parent 04238e050b
commit 6bde33f707

View file

@ -1,14 +1,13 @@
#!/bin/sh -e
first_install="$(snapctl get first-install)"
if [ -z "$first_install" ]; then
snapctl set first-install="false"
echo "first install, not doing any version comparison checks" >> "$SNAP_DATA/debuglog"
exit 0
fi
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
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"