fix(luci-app-haproxy): Correct container name in RPCD backend

Change container references from 'haproxy-lxc' to 'haproxy' to match
the actual container name used by secubox-app-haproxy. This fixes
the LuCI status view showing container_running: false.

Fixes affected methods:
- method_status: container existence and state checks
- method_get_stats: container running check

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-24 15:31:58 +01:00
parent a91bd48c3a
commit 47b2e1b8e1

View File

@ -55,15 +55,15 @@ method_status() {
stats_enabled=$(get_uci main stats_enabled 1)
# Check container status
if lxc-info -n haproxy-lxc >/dev/null 2>&1; then
container_running=$(lxc-info -n haproxy-lxc -s 2>/dev/null | grep -q "RUNNING" && echo "1" || echo "0")
if lxc-info -n haproxy >/dev/null 2>&1; then
container_running=$(lxc-info -n haproxy -s 2>/dev/null | grep -q "RUNNING" && echo "1" || echo "0")
else
container_running="0"
fi
# Check HAProxy process in container
if [ "$container_running" = "1" ]; then
haproxy_running=$(lxc-attach -n haproxy-lxc -- pgrep haproxy >/dev/null 2>&1 && echo "1" || echo "0")
haproxy_running=$(lxc-attach -n haproxy -- pgrep haproxy >/dev/null 2>&1 && echo "1" || echo "0")
else
haproxy_running="0"
fi
@ -83,7 +83,7 @@ method_status() {
method_get_stats() {
local stats_output
if lxc-info -n haproxy-lxc -s 2>/dev/null | grep -q "RUNNING"; then
if lxc-info -n haproxy -s 2>/dev/null | grep -q "RUNNING"; then
# Get stats via HAProxy socket
stats_output=$(run_ctl stats 2>/dev/null)
if [ -n "$stats_output" ]; then