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:
parent
a91bd48c3a
commit
47b2e1b8e1
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user