From: Stefan Schantl Date: Wed, 23 Nov 2016 07:29:34 +0000 (+0100) Subject: guardian.cgi: Also colorize OpenVPN RW subnet. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fguardian-horace;p=people%2Fstevee%2Fipfire-2.x.git guardian.cgi: Also colorize OpenVPN RW subnet. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/guardian.cgi b/html/cgi-bin/guardian.cgi index b7e1fd0dae..ffd62a4893 100644 --- a/html/cgi-bin/guardian.cgi +++ b/html/cgi-bin/guardian.cgi @@ -1252,7 +1252,24 @@ sub GrabNetworks() { my $multicast = "224.0.0.0/239.0.0.0"; $networks{$multicast} = ["$Lang::tr{'multicast'}","$Header::colourfw"]; - # Add OpenVPN tunnel connections. + # Add OpenVPN subnet for RW connections. + if (-e "${General::swroot}/ovpn/settings") { + my %ovpnsettings = (); + + # Read OpenVPN server settings for RW connections. + &General::readhash("${General::swroot}/ovpn/settings", \%ovpnsettings); + + # Check if the grabbed subnet is valid. + if (&Network::check_subnet($ovpnsettings{'DOVPN_SUBNET'})) { + # Grab the OpenVPN subnet. + my $ovpnsubnet = $ovpnsettings{'DOVPN_SUBNET'}; + + # Add the subnet to the networks hash. + $networks{$ovpnsubnet} = ["$Lang::tr{'ovpn'}", "$Header::colourvpn"]; + } + } + + # Add OpenVPN subnets for CCD connections. if (-e "${General::swroot}/ovpn/ccd.conf") { # Open the config file. open(OVPNSUB, "${General::swroot}/ovpn/ccd.conf");