FIX: Add error handling to FPM process count function

Fixed line 282 in lib/php-detector.sh:
- Changed: ps aux | grep | grep -v | wc -l
- To: local count=$(... || echo 0) with explicit echo

This prevents pipe failure with set -eo pipefail if no FPM processes
match the search pattern. Function now returns 0 instead of crashing.
This commit is contained in:
Developer
2026-03-19 22:33:06 -04:00
parent 3510686207
commit 9ab5298f85
+2 -1
View File
@@ -279,7 +279,8 @@ get_fpm_process_count() {
[ -z "$1" ] && return 1 [ -z "$1" ] && return 1
local pool_name="$1" # Usually username or domain local pool_name="$1" # Usually username or domain
ps aux | grep -E "php-fpm.*pool\s+${pool_name}" | grep -v grep | wc -l local count=$(ps aux | grep -E "php-fpm.*pool\s+${pool_name}" | grep -v grep | wc -l || echo 0)
echo "$count"
} }
# Get memory usage per FPM process for a pool # Get memory usage per FPM process for a pool