X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fconnections.cgi;fp=html%2Fcgi-bin%2Fconnections.cgi;h=00038f1a05bc4c758a5486d0979fa4ccd8d3f915;hp=8613b9d9b0c3126e81606baf4a5e18179432ae0b;hb=46443100e0eaa2bd7a23badc8eaeff9d3a1eca5d;hpb=fa7f2e219a4601e9d72b347afff8b21d34f789c2 diff --git a/html/cgi-bin/connections.cgi b/html/cgi-bin/connections.cgi index 8613b9d9b0..00038f1a05 100644 --- a/html/cgi-bin/connections.cgi +++ b/html/cgi-bin/connections.cgi @@ -146,6 +146,9 @@ if ($netsettings{'RED_DEV'}) { } } +# Call safe system_output function to get all available routes. +my @all_routes = &General::system_output("/sbin/route", "-n"); + # Add Green Firewall Interface push(@network, $netsettings{'GREEN_ADDRESS'}); push(@masklen, "255.255.255.255" ); @@ -157,7 +160,7 @@ push(@masklen, $netsettings{'GREEN_NETMASK'} ); push(@colour, ${Header::colourgreen} ); # Add Green Routes to Array -my @routes = `/sbin/route -n | /bin/grep $netsettings{'GREEN_DEV'}`; +my @routes = grep (/$netsettings{'GREEN_DEV'}/, @all_routes); foreach my $route (@routes) { chomp($route); my @temp = split(/[\t ]+/, $route); @@ -178,7 +181,7 @@ if ($netsettings{'BLUE_DEV'}) { push(@colour, ${Header::colourblue} ); # Add Blue Routes to Array - @routes = `/sbin/route -n | /bin/grep $netsettings{'BLUE_DEV'}`; + @routes = grep(/$netsettings{'BLUE_DEV'}/, @all_routes); foreach my $route (@routes) { chomp($route); my @temp = split(/[\t ]+/, $route); @@ -199,7 +202,7 @@ if ($netsettings{'ORANGE_DEV'}) { push(@masklen, $netsettings{'ORANGE_NETMASK'} ); push(@colour, ${Header::colourorange} ); # Add Orange Routes to Array - @routes = `/sbin/route -n | /bin/grep $netsettings{'ORANGE_DEV'}`; + @routes = grep(/$netsettings{'ORANGE_DEV'}/, @all_routes); foreach my $route (@routes) { chomp($route); my @temp = split(/[\t ]+/, $route);