bin/ius-dav-htuserexpiry
branchfoerste2
changeset 57 2b8cf6a91d0b
parent 25 8934ba3404bc
equal deleted inserted replaced
56:eea8bbbf3818 57:2b8cf6a91d0b
    18 #    Matthias Förste <foerste@schlittermann.de>
    18 #    Matthias Förste <foerste@schlittermann.de>
    19 
    19 
    20 use strict;
    20 use strict;
    21 use warnings;
    21 use warnings;
    22 
    22 
    23 use Ius::Dav::Htpasswd qw(readconfig userexpiry usage);
    23 use Ius::Dav::Htpasswd;
    24 
    24 
    25 use Getopt::Long;
    25 use Getopt::Long;
    26 use Pod::Usage;
    26 use Pod::Usage;
    27 
    27 
    28 GetOptions(
    28 GetOptions(
    29     'h|help' => sub { usage( -exit => 0, -verbose => 1 ) },
    29     'h|help' => sub { Ius::Dav::Htpasswd::usage( -exit => 0, -verbose => 1 ) },
    30     'm|man'  => sub {
    30     'm|man'  => sub {
    31         usage(
    31         Ius::Dav::Htpasswd::usage(
    32             -exit => 0,
    32             -exit => 0,
    33 
    33 
    34             # "system('perldoc -V &>/dev/null')" appears shorter, but may not
    34             # "system('perldoc -V &>/dev/null')" appears shorter, but may not
    35             # do what you expect ( it still returns 0 on debian squeeze with
    35             # do what you expect ( it still returns 0 on debian squeeze with
    36             # dash as system shell even if cannot find the command in $PATH)
    36             # dash as system shell even if cannot find the command in $PATH)
    37             -noperldoc => system('perldoc -V >/dev/null 2>&1'),
    37             -noperldoc => system('perldoc -V >/dev/null 2>&1'),
    38             -verbose   => 2
    38             -verbose   => 2
    39         );
    39         );
    40     },
    40     },
    41 ) or usage;
    41 ) or Ius::Dav::Htpasswd::usage;
    42 
    42 
    43 exit userexpiry readconfig;
    43 my $h = Ius::Dav::Htpasswd->new;
       
    44 $h->readconfig or die "Can't readconfig";
       
    45 exit $h->userexpiry;