mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 03:52:02 +02:00
snap: fix generated postrefreshhook script (#9994)
Fixes #9990 If the python oneliner to check certbot's version succeeded, exit_code would never be set, which would cause our exit_code check to fail. Use a check that handles unset exit_code
This commit is contained in:
@@ -25,7 +25,7 @@ cb_required=\$(grep -oP "version = '\K.*(?=')" \$SNAP/setup.py)
|
|||||||
|
|
||||||
\$SNAP/bin/python3 -c "import sys; from packaging import version; sys.exit(1) if\
|
\$SNAP/bin/python3 -c "import sys; from packaging import version; sys.exit(1) if\
|
||||||
version.parse('\$cb_installed') < version.parse('\$cb_required') else sys.exit(0)" || exit_code=\$?
|
version.parse('\$cb_installed') < version.parse('\$cb_required') else sys.exit(0)" || exit_code=\$?
|
||||||
if [ "\$exit_code" -eq 1 ]; then
|
if [ "\$exit_code" = "1" ]; then
|
||||||
echo "Certbot is version \$cb_installed but needs to be at least \$cb_required before" \\
|
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."
|
"this plugin can be updated; will try again on next refresh."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user