]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
ovpnmain.cgi: Use the helper binary to read the status log
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 3 Jun 2025 14:06:03 +0000 (16:06 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 3 Jun 2025 14:06:03 +0000 (16:06 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/ovpnmain.cgi
src/initscripts/system/openvpn-rw

index adf09029baeffb41e841310cf071fea7ec18f0a1..dfa47ad62d588ce25dc88a0fcc774bcec28124df 100644 (file)
@@ -3089,7 +3089,7 @@ END
                        </tr>
 END
 
-       open(FILE, $RW_STATUS) or die "Unable to open $RW_STATUS: $!";
+       open(FILE, "/usr/local/bin/openvpnctrl rw log |") or die "Unable to open $RW_STATUS: $!";
        my @current = <FILE>;
        close(FILE);
 
index 49b01daca5e2b76892ef0340dda32c6bcd991457..df83e47b7ee1778400d71076d1623e5e2d4b9538 100644 (file)
@@ -73,6 +73,12 @@ case "${1}" in
                statusproc /usr/sbin/openvpn
                ;;
 
+       log)
+               if [ -r "/var/run/openvpn-rw.log" ]; then
+                       cat "/var/run/openvpn-rw.log"
+               fi
+               ;;
+
        *)
                echo "Usage: ${0} {start|stop|reload|restart|status}"
                exit 1