[PATCHv2,3/7] general-functions.pl: Drop FetchPublicIp function.
Commit Message
This function has been reworked and moved into the
http-client-functions library.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
config/cfgroot/general-functions.pl | 21 ---------------------
1 file changed, 21 deletions(-)
@@ -17,7 +17,6 @@ package General;
use strict;
use Socket;
use IO::Socket;
-use Net::SSLeay;
use Net::IPv4Addr qw(:all);
$General::version = 'VERSION';
@@ -961,26 +960,6 @@ sub findhasharraykey {
}
}
-sub FetchPublicIp {
- my %proxysettings;
- &General::readhash("${General::swroot}/proxy/settings", \%proxysettings);
- if ($_=$proxysettings{'UPSTREAM_PROXY'}) {
- my ($peer, $peerport) = (/^(?:[a-zA-Z ]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/);
- Net::SSLeay::set_proxy($peer,$peerport,$proxysettings{'UPSTREAM_USER'},$proxysettings{'UPSTREAM_PASSWORD'} );
- }
- my $user_agent = &MakeUserAgent();
- my ($out, $response) = Net::SSLeay::get_http( 'checkip4.dns.lightningwirelabs.com',
- 80,
- "/",
- Net::SSLeay::make_headers('User-Agent' => $user_agent )
- );
- if ($response =~ m%HTTP/1\.. 200 OK%) {
- $out =~ /Your IP address is: (\d+.\d+.\d+.\d+)/;
- return $1;
- }
- return '';
-}
-
#
# Check if hostname.domain provided have IP provided
# use gethostbyname to verify that