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 1 by Douglas Thrift, 2003-11-05T17:58:20-08:00 vs.
FreeBSDAdmin/HostUpdate/hostupdate.pl (file contents), Revision 964 by douglas, 2007-11-29T00:16:53-08:00

# Line 1 | Line 1
1 < #!D:/Perl/bin/perl.exe
2 < #
3 < # Host Update
4 < #
5 < # Douglas Thrift
6 < #
7 < # $Id$
8 <
9 < use strict;
10 < use LWP::UserAgent;
11 < use POSIX;
12 <
13 < my $agent = LWP::UserAgent->new;
14 < my ($sysname, $nodename, $release, $version, $machine) = uname();
15 <
16 < $agent->agent("Host Update/1.0 ($sysname $release $machine) ");
17 <
18 < my $response = $agent->post("http://douglaspc/cgi-bin/printenv.pl", [host =>
19 <        $nodename]);
20 < my $content = $response->content;
21 <
22 < print "$content
23 < ";
1 > #!/usr/bin/env perl
2 > # Host Update
3 > #
4 > # Douglas Thrift
5 > #
6 > # $Id$
7 >
8 > use strict;
9 > use warnings;
10 > use File::Basename;
11 > use LWP::UserAgent;
12 > use MIME::Base64;
13 > use POSIX;
14 >
15 > my $topsecret = 'topsecret.douglasthrift.net';
16 > my $url = "https://$topsecret/cgi-bin/printenv.pl";
17 > my ($sysname, $nodename, $release, $version, $machine) = uname();
18 > my $agent = new LWP::UserAgent(agent => "HostUpdate/1.1 ($sysname $release $machine) ");
19 >
20 > {
21 >        my $user = getpwuid $<;
22 >
23 >        open PASS, "$ENV{HOME}/.HostUpdate.pass" or die "$0: $!\n";
24 >
25 >        my $pass = <PASS>;
26 >
27 >        chomp $pass;
28 >        close PASS;
29 >
30 >        $pass =~ tr/A-Za-z/N-ZA-Mn-za-m/;
31 >
32 >        $agent->credentials(new URI("$topsecret:443", 'Top Secret', $user, decode_base64($pass)));
33 > }
34 >
35 > $nodename .= ".douglasthrift.net" if ($nodename !~ /\./);
36 >
37 > my $response = $agent->post($url, [host => $nodename]);
38 >
39 > $response->is_success or die basename($0) . ': ' . $response->status_line;
40 >
41 > print $response->content;

Comparing:
HostUpdate/hostupdate.pl (property svn:eol-style), Revision 1 by Douglas Thrift, 2003-11-05T17:58:20-08:00 vs.
FreeBSDAdmin/HostUpdate/hostupdate.pl (property svn:eol-style), Revision 964 by douglas, 2007-11-29T00:16:53-08:00

# Line 0 | Line 1
1 + native

Comparing:
HostUpdate/hostupdate.pl (property svn:executable), Revision 1 by Douglas Thrift, 2003-11-05T17:58:20-08:00 vs.
FreeBSDAdmin/HostUpdate/hostupdate.pl (property svn:executable), Revision 964 by douglas, 2007-11-29T00:16:53-08:00

# Line 0 | Line 1
1 + *

Comparing:
HostUpdate/hostupdate.pl (property svn:keywords), Revision 1 by Douglas Thrift, 2003-11-05T17:58:20-08:00 vs.
FreeBSDAdmin/HostUpdate/hostupdate.pl (property svn:keywords), Revision 964 by douglas, 2007-11-29T00:16:53-08:00

# Line 0 | Line 1
1 + Id

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines