CRITICAL BUG #3: SYS_USER_HOME_BASE reset to empty after detection
Root Cause:
User reported SYS_USER_HOME_BASE was empty on Plesk server even though
Plesk detection was working correctly. Found variable initialization
happening AFTER detection completes, overwriting the value.
The Bug (lines 15-32):
if [ -z "$SYS_DETECTION_COMPLETE" ]; then
export SYS_CONTROL_PANEL=""
...
export SYS_LOG_DIR=""
fi
export SYS_USER_HOME_BASE="" # ← LINE 27 OUTSIDE CONDITIONAL!
export SYS_PHP_VERSIONS=()
...
Execution Flow:
1. Detection runs, sets SYS_USER_HOME_BASE="/var/www/vhosts"
2. Script continues, hits line 27
3. Line 27 UNCONDITIONALLY resets SYS_USER_HOME_BASE=""
4. Result: Variable is empty even though Plesk was detected
Impact:
- WordPress search used empty path instead of /var/www/vhosts
- Reference DB couldn't find WordPress installations
- Any code using SYS_USER_HOME_BASE got empty string
The Fix:
Moved lines 27-32 INSIDE the conditional block (lines 26-31):
if [ -z "$SYS_DETECTION_COMPLETE" ]; then
export SYS_CONTROL_PANEL=""
...
export SYS_LOG_DIR=""
export SYS_USER_HOME_BASE="" # Now only runs once
export SYS_PHP_VERSIONS=()
export SYS_CLOUDFLARE_ACTIVE=""
export SYS_FIREWALL=""
export SYS_FIREWALL_VERSION=""
export SYS_FIREWALL_ACTIVE=""
fi
Now variables are only initialized once on first detection,
not reset every time system-detect.sh is sourced.
Verified:
User's output showed SYS_CONTROL_PANEL="plesk" but
SYS_USER_HOME_BASE was empty. This fix ensures both are set.
Status: CRITICAL BUG #3 FIXED
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -23,13 +23,13 @@ if [ -z "$SYS_DETECTION_COMPLETE" ]; then
|
||||
export SYS_DB_TYPE=""
|
||||
export SYS_DB_VERSION=""
|
||||
export SYS_LOG_DIR=""
|
||||
fi
|
||||
export SYS_USER_HOME_BASE=""
|
||||
export SYS_PHP_VERSIONS=()
|
||||
export SYS_CLOUDFLARE_ACTIVE=""
|
||||
export SYS_FIREWALL=""
|
||||
export SYS_FIREWALL_VERSION=""
|
||||
export SYS_FIREWALL_ACTIVE=""
|
||||
fi
|
||||
|
||||
#############################################################################
|
||||
# CONTROL PANEL DETECTION
|
||||
|
||||
Reference in New Issue
Block a user