|
9 | 9 | # Shared Virtual Host Functions |
10 | 10 | # This file contains common functions used by both vhost-install.sh and vhost-import.sh |
11 | 11 | #---------------------------------------------------------------------------------- |
| 12 | +# Note: This file requires enginescript-common.sh to be sourced before it. |
| 13 | +# The following functions are defined in enginescript-common.sh and used here: |
| 14 | +# - prompt_yes_no() : Prompts the user for a yes/no answer with optional default and timeout |
| 15 | +# - restart_service() : Restarts a named system service via systemctl or service |
| 16 | +#---------------------------------------------------------------------------------- |
12 | 17 |
|
13 | 18 |
|
14 | 19 | # Check if required services are running |
@@ -115,7 +120,7 @@ create_ssl_certificate() { |
115 | 120 | mkdir -p "/etc/nginx/ssl/${DOMAIN}" |
116 | 121 |
|
117 | 122 | # Issue SSL Certificate |
118 | | - /root/.acme.sh/acme.sh --issue --force --dns dns_cf --server zerossl -d "${DOMAIN}" -d "admin.${DOMAIN}" -d "*.${DOMAIN}" -k ${SSL_KEYLENGTH} |
| 123 | + /root/.acme.sh/acme.sh --issue --force --dns dns_cf --server zerossl -d "${DOMAIN}" -d "admin.${DOMAIN}" -d "*.${DOMAIN}" -k "${SSL_KEYLENGTH}" |
119 | 124 |
|
120 | 125 | # Install SSL Certificate |
121 | 126 | /root/.acme.sh/acme.sh --install-cert -d "${DOMAIN}" --ecc \ |
@@ -637,14 +642,30 @@ install_enginescript_custom_plugins() { |
637 | 642 |
|
638 | 643 | # 1. EngineScript Site Optimizer plugin |
639 | 644 | mkdir -p "/tmp/enginescript-es-so-plugin" |
640 | | - wget -q "https://github.com/EngineScript/enginescript-site-optimizer/releases/download/v${ES_SO_PLUGIN_VER}/enginescript-site-optimizer-${ES_SO_PLUGIN_VER}.zip" -O "/tmp/enginescript-es-so-plugin/enginescript-site-optimizer-${ES_SO_PLUGIN_VER}.zip" |
641 | | - unzip -q -o "/tmp/enginescript-es-so-plugin/enginescript-site-optimizer-${ES_SO_PLUGIN_VER}.zip" -d "/var/www/sites/${SITE_URL}/html/wp-content/plugins/" |
| 645 | + wget -q "https://github.com/EngineScript/enginescript-site-optimizer/releases/download/v${ES_SO_PLUGIN_VER}/enginescript-site-optimizer-${ES_SO_PLUGIN_VER}.zip" -O "/tmp/enginescript-es-so-plugin/enginescript-site-optimizer-${ES_SO_PLUGIN_VER}.zip" || { |
| 646 | + echo "ERROR: Failed to download EngineScript Site Optimizer plugin (version ${ES_SO_PLUGIN_VER})." |
| 647 | + rm -rf "/tmp/enginescript-es-so-plugin" |
| 648 | + return 1 |
| 649 | + } |
| 650 | + unzip -q -o "/tmp/enginescript-es-so-plugin/enginescript-site-optimizer-${ES_SO_PLUGIN_VER}.zip" -d "/var/www/sites/${SITE_URL}/html/wp-content/plugins/" || { |
| 651 | + echo "ERROR: Failed to extract EngineScript Site Optimizer plugin archive." |
| 652 | + rm -rf "/tmp/enginescript-es-so-plugin" |
| 653 | + return 1 |
| 654 | + } |
642 | 655 | rm -rf "/tmp/enginescript-es-so-plugin" |
643 | 656 |
|
644 | 657 | # 2. EngineScript Site Exporter plugin |
645 | 658 | mkdir -p "/tmp/enginescript-es-se-plugin" |
646 | | - wget -q "https://github.com/EngineScript/enginescript-site-exporter/releases/download/v${ES_SE_PLUGIN_VER}/enginescript-site-exporter-${ES_SE_PLUGIN_VER}.zip" -O "/tmp/enginescript-es-se-plugin/enginescript-site-exporter-${ES_SE_PLUGIN_VER}.zip" |
647 | | - unzip -q -o "/tmp/enginescript-es-se-plugin/enginescript-site-exporter-${ES_SE_PLUGIN_VER}.zip" -d "/var/www/sites/${SITE_URL}/html/wp-content/plugins/" |
| 659 | + wget -q "https://github.com/EngineScript/enginescript-site-exporter/releases/download/v${ES_SE_PLUGIN_VER}/enginescript-site-exporter-${ES_SE_PLUGIN_VER}.zip" -O "/tmp/enginescript-es-se-plugin/enginescript-site-exporter-${ES_SE_PLUGIN_VER}.zip" || { |
| 660 | + echo "ERROR: Failed to download EngineScript Site Exporter plugin (version ${ES_SE_PLUGIN_VER})." |
| 661 | + rm -rf "/tmp/enginescript-es-se-plugin" |
| 662 | + return 1 |
| 663 | + } |
| 664 | + unzip -q -o "/tmp/enginescript-es-se-plugin/enginescript-site-exporter-${ES_SE_PLUGIN_VER}.zip" -d "/var/www/sites/${SITE_URL}/html/wp-content/plugins/" || { |
| 665 | + echo "ERROR: Failed to extract EngineScript Site Exporter plugin archive." |
| 666 | + rm -rf "/tmp/enginescript-es-se-plugin" |
| 667 | + return 1 |
| 668 | + } |
648 | 669 | rm -rf "/tmp/enginescript-es-se-plugin" |
649 | 670 | else |
650 | 671 | echo "Skipping EngineScript custom plugins installation (disabled in config)..." |
|
0 commit comments