/[pdpsoft]/nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl.cin
ViewVC logotype

Diff of /nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl.cin

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl revision 2604 by davidg, Mon Feb 25 11:59:39 2013 UTC nl.nikhef.pdp.fetchcrl/trunk/fetch-crl3.pl.cin revision 2691 by davidg, Tue Mar 4 16:33:30 2014 UTC
# Line 25  use Getopt::Long qw(:config no_ignore_ca Line 25  use Getopt::Long qw(:config no_ignore_ca
25  use POSIX;  use POSIX;
26  eval { require LWP or die; }; $@ and die "Please install libwww-perl (LWP)\n";  eval { require LWP or die; }; $@ and die "Please install libwww-perl (LWP)\n";
27    
28    my $sccsid = '@(#)$Id$';
29    
30  # import modules that are needed but still external  # import modules that are needed but still external
31  # (the installed version may have these packages embedded in-line)  # (the installed version may have these packages embedded in-line)
32  #  #
# Line 48  use vars qw/ $log $cnf /; Line 50  use vars qw/ $log $cnf /;
50    
51  # use Net::INET6Glue if so requested (is not a default module)  # use Net::INET6Glue if so requested (is not a default module)
52  if ( $cnf->{_}->{inet6glue} ) {  if ( $cnf->{_}->{inet6glue} ) {
53    eval { require Net::INET6Glue or die; };    eval { require Net::INET6Glue::INET_is_INET6 or die; };
54    $@ and die "Please install Net::INET6Glue before enabling inet6glue config\n";    $@ and die "Please install Net::INET6Glue before enabling inet6glue config\n";
55  }  }
56    
# Line 65  $use_DataDumper and $::log->verb(7,Data: Line 67  $use_DataDumper and $::log->verb(7,Data:
67  # set safe path if so requested  # set safe path if so requested
68  $cnf->{_}->{path} and $ENV{"PATH"} = $cnf->{_}->{path} and  $cnf->{_}->{path} and $ENV{"PATH"} = $cnf->{_}->{path} and
69    $::log->verb(5,"Set PATH to",$ENV{"PATH"});    $::log->verb(5,"Set PATH to",$ENV{"PATH"});
70    
71    # set rcmode if present in config
72    defined $cnf->{_}->{rcmode} and do {
73      $::log->err("Invalid return code mode set (must be 0 or 1)")
74        if ( $cnf->{_}->{rcmode} != 0 && $cnf->{_}->{rcmode} != 1 );
75      $::log->verb(2,"Exit status mode is set to ".$cnf->{_}->{rcmode});
76      $::log->setrcmode($cnf->{_}->{rcmode});
77    };
78        
79  # wait up to randomwait seconds to spread download load  # wait up to randomwait seconds to spread download load
80  $cnf->{_}->{randomwait} and do {  $cnf->{_}->{randomwait} and do {
# Line 115  sub init_configuration() { Line 125  sub init_configuration() {
125    my $verbosity;    my $verbosity;
126    my $quiet=0;    my $quiet=0;
127    my $help=0;    my $help=0;
128      my $showversion=0;
129    my $debuglevel;    my $debuglevel;
130    my $parallelism=0;    my $parallelism=0;
131    my $randomwait;    my $randomwait;
# Line 135  sub init_configuration() { Line 146  sub init_configuration() {
146      "format=s@" => \@formats,      "format=s@" => \@formats,
147      "v|verbose+" => \$verbosity,      "v|verbose+" => \$verbosity,
148      "h|help+" => \$help,      "h|help+" => \$help,
149        "V|version+" => \$showversion,
150      "q|quiet+" => \$quiet,      "q|quiet+" => \$quiet,
151      "d|debug+" => \$debuglevel,      "d|debug+" => \$debuglevel,
152      "p|parallelism=i" => \$parallelism,      "p|parallelism=i" => \$parallelism,
# Line 145  sub init_configuration() { Line 157  sub init_configuration() {
157      ) or &help and exit(1);      ) or &help and exit(1);
158    
159    $help and &help and exit(0);    $help and &help and exit(0);
160      $showversion and &showversion and exit(0);
161    
162    $configfile ||= ( -e "/etc/fetch-crl.conf" and "/etc/fetch-crl.conf" );    $configfile ||= ( -e "/etc/fetch-crl.conf" and "/etc/fetch-crl.conf" );
163    $configfile ||= ( -e "/etc/fetch-crl.cnf" and "/etc/fetch-crl.cnf" );    $configfile ||= ( -e "/etc/fetch-crl.cnf" and "/etc/fetch-crl.cnf" );
# Line 244  sub init_configuration() { Line 257  sub init_configuration() {
257  # ###########################################################################  # ###########################################################################
258  #  #
259  #  #
260    sub showversion() {
261      (my $name = $0) =~ s/.*\///;
262      print "$name version @VERSION@\n";
263      return 1;
264    }
265    
266  sub help() {  sub help() {
267    (my $name = $0) =~ s/.*\///;    (my $name = $0) =~ s/.*\///;
268  print <<EOHELP;  print <<EOHELP;
# Line 290  Options: Line 309  Options:
309   -h | --help   -h | --help
310          This help text          This help text
311    
312    Version: @VERSION@
313  EOHELP  EOHELP
314    
315    return 1;    return 1;

Legend:
Removed from v.2604  
changed lines
  Added in v.2691

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