upgrade to snap certbot if old one is used (#2267)
This commit is contained in:
Родитель
6c03ab9e00
Коммит
f7f5ea6b85
22
lib.sh
22
lib.sh
|
@ -769,11 +769,25 @@ fi
|
|||
|
||||
# Install certbot (Let's Encrypt)
|
||||
install_certbot() {
|
||||
certbot --version 2> /dev/null
|
||||
LE_IS_AVAILABLE=$?
|
||||
if [ $LE_IS_AVAILABLE -eq 0 ]
|
||||
if certbot --version >/dev/null 2>&1
|
||||
then
|
||||
certbot --version 2> /dev/null
|
||||
# Reinstall certbot (use snap instead of package)
|
||||
# https://askubuntu.com/a/1271565
|
||||
if dpkg -l | grep certbot >/dev/null 2>&1
|
||||
then
|
||||
# certbot will be removed, but still listed, so we need to check if the snap is installed as well so that this doesn't run every time
|
||||
if ! snap list certbot >/dev/null 2>&1
|
||||
then
|
||||
print_text_in_color "$ICyan" "Reinstalling certbot (Let's Encrypt) as a snap instead..."
|
||||
apt-get remove certbot -y
|
||||
apt-get autoremove -y
|
||||
install_if_not snapd
|
||||
snap install core
|
||||
snap install certbot --classic
|
||||
# Update $PATH in current session (login and logout is required otherwise)
|
||||
check_command hash -r
|
||||
fi
|
||||
fi
|
||||
else
|
||||
print_text_in_color "$ICyan" "Installing certbot (Let's Encrypt)..."
|
||||
install_if_not snapd
|
||||
|
|
Загрузка…
Ссылка в новой задаче