[PATCHv2,5/7] ddns.cgi, wio.cgi: Use GetDyndnsRedIP from http-client-functions.pl file

Message ID 20250418110741.7756-6-stefan.schantl@ipfire.org
State New
Headers
Series Introduce perl LWP-based flexible downloader function |

Commit Message

Stefan Schantl April 18, 2025, 10:54 a.m. UTC
  Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 html/cgi-bin/ddns.cgi | 3 ++-
 html/cgi-bin/wio.cgi  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/html/cgi-bin/ddns.cgi b/html/cgi-bin/ddns.cgi
index 0e3ccbe45..34475b75c 100644
--- a/html/cgi-bin/ddns.cgi
+++ b/html/cgi-bin/ddns.cgi
@@ -29,6 +29,7 @@  use experimental 'smartmatch';
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
+require "${General::swroot}/http-client-functions.pl";
 
 #workaround to suppress a warning when a variable is used only once
 my @dummy = ( ${Header::table2colour}, ${Header::colouryellow} );
@@ -559,7 +560,7 @@  open(FILE, $datafile) or die "Unable to open $datafile.";
 close(FILE);
 
 # Get IP address of the red interface.
-my $ip = &General::GetDyndnsRedIP();
+my $ip = &HTTPClient::GetDyndnsRedIP();
 my $id = 0;
 my $toggle_enabled;
 
diff --git a/html/cgi-bin/wio.cgi b/html/cgi-bin/wio.cgi
index f31f5d565..30a51104c 100644
--- a/html/cgi-bin/wio.cgi
+++ b/html/cgi-bin/wio.cgi
@@ -50,6 +50,7 @@  require '/var/ipfire/general-functions.pl';
 require '/var/ipfire/network-functions.pl';
 require '/var/ipfire/lang.pl';
 require '/var/ipfire/header.pl';
+require '/var/ipfire/http-client-functions.pl';
 require '/usr/lib/wio/wio-lib.pl';
 require '/usr/lib/wio/wio-graphs.pl';
 
@@ -1163,7 +1164,7 @@  close (FILE);
 		@temp = split (/\,/, $_);
 
 		if ( $temp[7] eq "on" ) {
-			$bgcolor = ( &General::DyndnsServiceSync (&General::GetDyndnsRedIP,$temp[1],$temp[2]) ? "$Header::colourgreen" : "$Header::colourred" );
+			$bgcolor = ( &General::DyndnsServiceSync (&HTTPClient::GetDyndnsRedIP,$temp[1],$temp[2]) ? "$Header::colourgreen" : "$Header::colourred" );
 		}
 		else {
 			$bgcolor = "blue";