- safe_system ("uname", "-n");
- if (-f "/etc/redhat-release") { system ("cat", "/etc/redhat-release"); }
- safe_system ("uname", "-sr");
- print "\n";
- safe_system ("date", "+%c");
- print "\n";
- my $ut = `uptime`;
- $ut =~ s/^[ \d:]*//;
- $ut =~ s/,\s*(load)/\n$1/;
- print "$ut\n";
- }
-
-}
-
-
-# Loads the given URL, returns: $http, $head, $body.
-#
-sub get_url_1($;$) {
- my ($url, $referer) = @_;
-
- if (! ($url =~ m@^http://@i)) {
- error ("not an HTTP URL: $url");
- }
-
- my ($url_proto, $dummy, $serverstring, $path) = split(/\//, $url, 4);
- $path = "" unless $path;
-
- my ($them,$port) = split(/:/, $serverstring);
- $port = 80 unless $port;
-
- my $them2 = $them;
- my $port2 = $port;
- if ($http_proxy) {
- $serverstring = $http_proxy if $http_proxy;
- $serverstring =~ s@^[a-z]+://@@;
- ($them2,$port2) = split(/:/, $serverstring);
- $port2 = 80 unless $port2;
- }
-
- my ($remote, $iaddr, $paddr, $proto, $line);
- $remote = $them2;
- if ($port2 =~ /\D/) { $port2 = getservbyname($port2, 'tcp') }
- if (!$port2) {
- error ("unrecognised port in $url");
- }
-
- $iaddr = inet_aton($remote);
- error ("host not found: $remote") unless ($iaddr);
-
- $paddr = sockaddr_in($port2, $iaddr);