mirror of
https://github.com/certbot/certbot.git
synced 2026-06-09 08:42:57 -04:00
if we use post and pre together we can do this
This commit is contained in:
parent
9ed789df0f
commit
fd1d15c2b0
2 changed files with 15 additions and 7 deletions
|
|
@ -1,15 +1,12 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
first_install="$(snapctl get first-install)"
|
||||
if [ -z "$first_install" ]; then
|
||||
snapctl set first-install="false"
|
||||
# get certbot version
|
||||
cb_installed="$(snapctl get cb-installed)"
|
||||
|
||||
if [ -z "$cb_installed" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ls $SNAP/certbot-version
|
||||
|
||||
# get certbot version
|
||||
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)
|
||||
|
||||
|
|
|
|||
11
certbot-dns-dnsimple/snap/hooks/pre-refresh
Normal file
11
certbot-dns-dnsimple/snap/hooks/pre-refresh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
first_install="$(snapctl get first-install)"
|
||||
if [ -z "$first_install" ]; then
|
||||
snapctl set first-install="false"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cb_installed=$(grep -oP "__requires__ = 'certbot==\K.*(?=')" $SNAP/certbot-version/certbot)
|
||||
echo "cb_installed $cb_installed"
|
||||
snapctl set cb-installed="$cb_installed"
|
||||
Loading…
Reference in a new issue