6 use Net
::Domain qw
/hostname/;
9 my $latest_host = undef;
11 foreach my $url (@ARGV) {
12 my $data = get
( $url );
13 next if not defined $data;
15 my( $hostname, $time ) = split( /\s*\n\s*/, $data );
17 next unless defined $time;
18 if( $time > $latest_time ) {
19 $latest_host = $hostname;
24 if( time() > $latest_time + 2*60*60 ) {
25 # The latest update was started more than two hours ago.
26 # We should do an update.
29 elsif( $latest_host eq hostname
() ) {
30 # We did the last update. We should update now as well.
34 # print "Update cancelled.\n";