From c232e3489ada10b19ca00f675f2e7a930e9164a5 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Fri, 29 Apr 2016 11:06:06 +0200 Subject: [PATCH] guardian.cgi: Use private subfunction for gateway and DNS server detection. Signed-off-by: Stefan Schantl --- html/cgi-bin/guardian.cgi | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 '') { -- 2.39.5