From 345c97c6341d31eb644ac9387058c9aea9ba6d8e Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 3 Apr 2025 01:58:51 +0800 Subject: [PATCH] Improved Certbot installation --- mbadmin.jps | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/mbadmin.jps b/mbadmin.jps index 3dc6934..edf50f5 100644 --- a/mbadmin.jps +++ b/mbadmin.jps @@ -55,9 +55,23 @@ onInstall: - 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 - chmod +x *.sh - # Install Certbot for AlmaLinux - - dnf install -y certbot - - dnf install -y python3-certbot-dns-cloudflare + # Install Certbot for AlmaLinux with memory constraints + - echo "Installing Certbot... (this may take a few minutes)" + - 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: - confirmText: Are you sure you want to execute this WP-CLI command?