]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ovpnmain.cgi: Change status extraction for RW connection statistics page
authorAdolf Belka <adolf.belka@ipfire.org>
Sat, 11 Apr 2026 11:45:30 +0000 (13:45 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 13 Apr 2026 09:12:20 +0000 (09:12 +0000)
- 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>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/ovpnmain.cgi

index b0d950cbbe54c14cb74efbd2424ac8abb28590ae..def043d9b0513b991c7504af17c74c7ec9b41654 100644 (file)
@@ -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");