/[pdpsoft]/nl.nikhef.ndpf.tools/trustedget/trustedget.cin
ViewVC logotype

Contents of /nl.nikhef.ndpf.tools/trustedget/trustedget.cin

Parent Directory Parent Directory | Revision Log Revision Log


Revision 19 - (show annotations) (download)
Tue Aug 5 10:14:53 2008 UTC (14 years, 1 month ago) by davidg
File size: 530 byte(s)
Added trustedget command

1 #! /usr/bin/perl -w
2 #
3 # @(#)$Id$
4 #
5 use strict;
6 use LWP::UserAgent;
7
8 my ($ua,$localport)=(undef,500);
9
10 @LWP::Protocol::http::EXTRA_SOCK_OPTS=();
11 while ( !$ua && $localport<1024 ) {
12 @LWP::Protocol::http::EXTRA_SOCK_OPTS=("LocalPort",$localport);
13 $ua = LWP::UserAgent->new;
14 $localport++;
15 }
16 die "Ran out of trusted ports\n" unless $ua;
17
18
19 my $res = $ua->get(@ARGV);
20 if ( $res->is_success ) {
21 print $res->content;
22 } else {
23 my ($status,$message) = split(/\s+/,($res->status_line),2);
24 print "$status $message\n";
25 exit 1;
26 }
27

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28