#!/usr/bin/perl
#
# Host Update
#
# Douglas Thrift
#
# $Id$

use strict;
use LWP::UserAgent;
use POSIX;
use MIME::Base64 qw(encode_base64);

my $agent = LWP::UserAgent->new;
my ($sysname, $nodename, $release, $version, $machine) = uname();

if (!($nodename =~ /\./))
{
	$nodename .= ".douglasthrift.net";
}

$agent->agent("Host Update/1.0 ($sysname $release $machine) ");

my $response = $agent->post("http://topsecret.douglasthrift.net/auth/hostupdate.cgi", [host => $nodename], Authorization => "Basic " . encode_base64("HostUpdate:frell2003"));
my $content = $response->content;

print "$content";
