From bc15e0fc8e9dfacd74a8f11e337360279c84dfed Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 3 Jun 2025 17:04:50 +0200 Subject: [PATCH] ovpnmain.cgi: Only load status when the server is running Otherwise we would show the status if the service is no longer running and show clients as connected which have only been connected when the server was stopped. Signed-off-by: Michael Tremer --- html/cgi-bin/ovpnmain.cgi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi index 2b3e16b45..b85bc0d63 100644 --- a/html/cgi-bin/ovpnmain.cgi +++ b/html/cgi-bin/ovpnmain.cgi @@ -5020,9 +5020,14 @@ END &General::readhasharray("${General::swroot}/ovpn/caconfig", \%cahash); &General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash); - open(FILE, "/usr/local/bin/openvpnctrl rw log |"); - my @status = ; - close(FILE); + my @status = (); + + # Only load status when the RW server is enabled + if ($vpnsettings{'ENABLED'} eq 'on') { + open(FILE, "/usr/local/bin/openvpnctrl rw log |"); + @status = ; + close(FILE); + } $checked{'ENABLED'}{'off'} = ''; $checked{'ENABLED'}{'on'} = ''; -- 2.39.5