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 |
|
|
$agent->agent("Host Update/1.0 ($sysname $release $machine) "); |
18 |
|
|
|
19 |
Douglas Thrift |
18 |
my $response = $agent->post("http://topsecret.douglasthrift.net/auth/hostupdat" |
20 |
|
|
. "e.cgi", [host => $nodename], Authorization => "Basic " . |
21 |
|
|
encode_base64("HostUpdate:frell2003")); |
22 |
Douglas Thrift |
3 |
my $content = $response->content; |
23 |
|
|
|
24 |
Douglas Thrift |
13 |
print "$content"; |