ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FreeBSDAdmin/HostUpdate/HostUpdate.pl
(Generate patch)

Comparing:
HostUpdate/hostupdate.pl (file contents), Revision 3 by Douglas Thrift, 2003-11-05T18:37:16-08:00 vs.
FreeBSDAdmin/HostUpdate/hostupdate.pl (file contents), Revision 963 by douglas, 2007-11-28T23:43:19-08:00

# Line 1 | Line 1
1 < #!D:/Perl/bin/perl.exe
1 > #!/usr/bin/perl
2   #
3   # Host Update
4   #
# Line 9 | Line 9
9   use strict;
10   use LWP::UserAgent;
11   use POSIX;
12 + use MIME::Base64 qw(encode_base64);
13  
14   my $agent = LWP::UserAgent->new;
15   my ($sysname, $nodename, $release, $version, $machine) = uname();
16  
17 + if (!($nodename =~ /\./))
18 + {
19 +        $nodename .= ".douglasthrift.net";
20 + }
21 +
22   $agent->agent("Host Update/1.0 ($sysname $release $machine) ");
23  
24 < my $response = $agent->post("http://douglaspc/cgi-bin/printenv.pl", [host =>
19 <        $nodename]);
24 > my $response = $agent->post("http://topsecret.douglasthrift.net/auth/hostupdate.cgi", [host => $nodename], Authorization => "Basic " . encode_base64("HostUpdate:"));
25   my $content = $response->content;
26  
27 < print "$content
23 < ";
27 > print "$content";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines