Improved Certbot installation

main
Anthony 2025-04-03 01:58:51 +08:00
parent ca001bcec7
commit 345c97c634
1 changed files with 17 additions and 3 deletions

View File

@ -55,9 +55,23 @@ onInstall:
- curl -OL https://deploy-proxy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/ssl-manager/xmlchecker.sh - curl -OL https://deploy-proxy.mightybox.io/tony/mb-admin/raw/branch/main/scripts/ssl-manager/xmlchecker.sh
- if [ ! -f xmlchecker.sh ]; then echo "Failed to download xmlchecker.sh"; exit 1; fi - if [ ! -f xmlchecker.sh ]; then echo "Failed to download xmlchecker.sh"; exit 1; fi
- chmod +x *.sh - chmod +x *.sh
# Install Certbot for AlmaLinux # Install Certbot for AlmaLinux with memory constraints
- dnf install -y certbot - echo "Installing Certbot... (this may take a few minutes)"
- dnf install -y python3-certbot-dns-cloudflare - MEMFREE=$(free -m | grep "Mem:" | awk '{print $4}')
- echo "Available memory: ${MEMFREE}MB"
- if [ $MEMFREE -lt 500 ]; then
echo "Low memory detected (${MEMFREE}MB), running dnf with minimal memory usage";
dnf install -y --setopt=install_weak_deps=False --best --allowerasing certbot || echo "Certbot installation failed but continuing";
else
dnf install -y certbot || echo "Certbot installation failed but continuing";
fi
# Only install DNS plugin if certbot was installed successfully
- if command -v certbot > /dev/null; then
echo "Installing Certbot DNS plugin...";
dnf install -y --setopt=install_weak_deps=False python3-certbot-dns-cloudflare || echo "DNS plugin installation failed but continuing";
else
echo "Skipping DNS plugin installation as Certbot wasn't installed";
fi
menu: menu:
- confirmText: Are you sure you want to execute this WP-CLI command? - confirmText: Are you sure you want to execute this WP-CLI command?