Fix-15015: check correct path for certbot (#15034)

Co-authored-by: galz55 <damianbc-github@gmail.com>
This commit is contained in:
galz55
2026-06-22 21:11:14 +02:00
committed by GitHub
parent 7f363170f3
commit c1a6dc29ee
+7 -1
View File
@@ -221,7 +221,13 @@ EOF
msg_ok "Initialized Backend"
msg_info "Starting Services"
CERTBOT_VER=$(/opt/certbot/bin/certbot --version 2>&1 | awk '{print $NF}')
if [ -f /opt/certbot/bin/certbot ]; then
CERTBOT_VER=$(/opt/certbot/bin/certbot --version 2>&1 | awk '{print $NF}' || echo "0.0.0")
elif command -v certbot &>/dev/null; then
CERTBOT_VER=$(certbot --version 2>&1 | awk '{print $NF}' || echo "0.0.0")
else
CERTBOT_VER="2.0.0"
fi
if grep -q "Environment=CERTBOT_VERSION" /lib/systemd/system/npm.service; then
sed -i "s|Environment=CERTBOT_VERSION=.*|Environment=CERTBOT_VERSION=${CERTBOT_VER}|" /lib/systemd/system/npm.service
else