Improved Certbot installation
parent
ca001bcec7
commit
345c97c634
20
mbadmin.jps
20
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?
|
||||
|
|
Loading…
Reference in New Issue