From: Stefan Schantl Date: Fri, 29 Apr 2016 09:06:06 +0000 (+0200) Subject: guardian.cgi: Use private subfunction for gateway and DNS server detection. X-Git-Tag: v2.19-core104~8^2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c232e3489ada10b19ca00f675f2e7a930e9164a5;p=ipfire-2.x.git guardian.cgi: Use private subfunction for gateway and DNS server detection. Signed-off-by: Stefan Schantl --- diff --git a/html/cgi-bin/guardian.cgi b/html/cgi-bin/guardian.cgi index 634f87d534..7ba49f443d 100644 --- a/html/cgi-bin/guardian.cgi +++ b/html/cgi-bin/guardian.cgi @@ -291,8 +291,17 @@ if ($settings{'ACTION'} eq $Lang::tr{'save'}) { my $orange = $netsettings{'ORANGE_ADDRESS'}; my $red = $netsettings{'RED_ADDRESS'}; + # File declarations. + my $gatewayfile = "${General::swroot}/red/remote-ipaddress"; + my $dns1file = "${General::swroot}/red/dns1"; + my $dns2file = "${General::swroot}/red/dns2"; + # Get gateway address. - my $gateway = &General::get_gateway(); + my $gateway = &_get_address_from_file($gatewayfile); + + # Get addresses from the used dns servers. + my $dns1 = &_get_address_from_file($dns1file); + my $dns2 = &_get_address_from_file($dns2file); # Check if any input has been performed. if ($input eq '') {