ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/FreeBSDAdmin/HostUpdate/HostUpdate.pl
Revision: 963
Committed: 2007-11-28T23:43:19-08:00 (17 years, 6 months ago) by douglas
Content type: text/x-perl
Original Path: FreeBSDAdmin/HostUpdate/hostupdate.pl
File size: 592 byte(s)
Log Message:
Hmm, better to do this on slowhand currently...

File Contents

# User Rev Content
1 Douglas Thrift 14 #!/usr/bin/perl
2 Douglas Thrift 3 #
3     # Host Update
4     #
5     # Douglas Thrift
6     #
7     # $Id$
8    
9     use strict;
10     use LWP::UserAgent;
11     use POSIX;
12 Douglas Thrift 18 use MIME::Base64 qw(encode_base64);
13 Douglas Thrift 3
14     my $agent = LWP::UserAgent->new;
15     my ($sysname, $nodename, $release, $version, $machine) = uname();
16    
17 Douglas Thrift 107 if (!($nodename =~ /\./))
18     {
19 douglas 767 $nodename .= ".douglasthrift.net";
20 Douglas Thrift 107 }
21    
22 Douglas Thrift 3 $agent->agent("Host Update/1.0 ($sysname $release $machine) ");
23    
24 douglas 963 my $response = $agent->post("http://topsecret.douglasthrift.net/auth/hostupdate.cgi", [host => $nodename], Authorization => "Basic " . encode_base64("HostUpdate:"));
25 Douglas Thrift 3 my $content = $response->content;
26    
27 Douglas Thrift 13 print "$content";

Properties

Name Value
svn:eol-style native
svn:executable *
svn:keywords Id