[5/7] ovpnmain.cgi: Change status extraction for RW connection statistics page

Message ID 20260411114532.43348-5-adolf.belka@ipfire.org
State Staged
Commit f825523e32b44196ebb39f79ae2bd417f8d0f7a8
Headers
Series [1/7] openvpn: Update to version 2.7.1 |

Commit Message

Adolf Belka 11 Apr 2026, 11:45 a.m. UTC
- The format of the status file has changed in 2.7.0
- This patch changes the regex to extract requyired status to maintain the same status
   output

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 html/cgi-bin/ovpnmain.cgi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/html/cgi-bin/ovpnmain.cgi b/html/cgi-bin/ovpnmain.cgi
index b0d950cbb..def043d9b 100644
--- a/html/cgi-bin/ovpnmain.cgi
+++ b/html/cgi-bin/ovpnmain.cgi
@@ -3178,8 +3178,8 @@  END
 			@match = split(/^Updated,(.+)/, $line);
 			$status = $match[1];
 
-		} elsif ( $line =~ /^(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/) {
-			@match = split(m/^(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/, $line);
+		} elsif ( $line =~ /^(.+),(.+\:\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/) {
+			@match = split(m/^(.+),(.+\:\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/, $line);
 
 			# Skip the header
 			next if ($match[1] eq "Common Name");
@@ -3196,8 +3196,8 @@  END
 			$users[$uid]{'Country'} = &Location::Functions::lookup_country_code($address);
 			$uid++;
 
-		} elsif ($line =~ /^(\d+\.\d+\.\d+\.\d+),(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(.+)/) {
-			@match = split(m/^(\d+\.\d+\.\d+\.\d+),(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(.+)/, $line);
+		} elsif ($line =~ /^(\d+\.\d+\.\d+\.\d+),(.+),(.+\:\d+\.\d+\.\d+\.\d+\:\d+),(.+)/) {
+			@match = split(m/^(\d+\.\d+\.\d+\.\d+),(.+),(.+\:\d+\.\d+\.\d+\.\d+\:\d+),(.+)/, $line);
 
 			# Skip the header
 			next if ($match[1] eq "Virtual Address");