guardian.cgi: Use private subfunction for gateway and DNS server detection.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
Stefan Schantl
2016-04-29 11:06:06 +02:00
parent 97849142bd
commit c232e3489a

View File

@@ -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 '') {