From: Michael Tremer Date: Tue, 3 Jun 2025 15:04:50 +0000 (+0200) Subject: ovpnmain.cgi: Only load status when the server is running X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc15e0fc8e9dfacd74a8f11e337360279c84dfed;p=people%2Fms%2Fipfire-2.x.git 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 --- 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'} = '';