Welcome to mirror list, hosted at ThFree Co, Russian Federation.

post-refresh « hooks « snap « certbot-dns-dnsimple - github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3ae7ef9c70f211af58b2a10866c1f0ddfc8e3c69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh -e

# get certbot version
if [ ! -f "$SNAP/certbot-shared/certbot-version.txt" ]; then
  echo "No certbot version available; not doing version comparison check" >> "$SNAP_DATA/debuglog"
  exit 0
fi
cb_installed=$(cat $SNAP/certbot-shared/certbot-version.txt)

# get required certbot version for plugin
cb_required=$(grep -oP "certbot>=\K.*(?=')" $SNAP/setup.py)

python3 -c "from distutils.version import LooseVersion; import sys; sys.exit(1) if\
  LooseVersion('$cb_installed') < LooseVersion('$cb_required') else sys.exit(0)" || exit_code=$?
if [ "$exit_code" -eq 1 ]; then
  echo "Certbot is version $cb_installed but needs to be at least $cb_required before" \
    "this plugin can be updated; will try again on next refresh."
  exit 1
fi