Fix: Double arithmetic syntax error in generate_comparison_report (line 2073)

This commit is contained in:
Developer
2026-04-23 21:16:33 -04:00
parent 8af1ca881b
commit ca7ec62e02
12 changed files with 121 additions and 70 deletions
+22 -2
View File
@@ -31,6 +31,9 @@ if [ "$EUID" -ne 0 ]; then
exit 1
fi
# Ensure reference database is fresh (only rebuild if > 1 hour old)
db_ensure_fresh 2>/dev/null || true
# Configuration
BACKUP_DIR="/root/nginx-varnish-backups"
VARNISH_VCL="/etc/varnish/default.vcl"
@@ -149,11 +152,28 @@ create_backup() {
echo "$backup_path"
}
# Get list of cPanel domains
# Get list of cPanel domains (from launcher cache, not filesystem)
get_cpanel_domains() {
# Use launcher's cached domain list (instant lookup, already filtered by launcher)
# Fallback to filesystem scan only if cache unavailable
if command -v db_get_all_domains &>/dev/null; then
# Use cached data from launcher (built on startup, instant O(n) lookup)
db_get_all_domains 2>/dev/null || {
# Fallback if cache fails (shouldn't happen if db_ensure_fresh was called)
get_cpanel_domains_fallback
}
else
# Library not available, use filesystem fallback
get_cpanel_domains_fallback
fi
}
# Fallback domain discovery (only used if cache unavailable)
get_cpanel_domains_fallback() {
local domains=()
# Get domains from cPanel user data
# Fallback: Get domains from cPanel user data
if [ -d /var/cpanel/userdata ]; then
while IFS= read -r domain_file; do
local domain=$(basename "$domain_file")