Apache2-Authen-Passphrase

 view release on metacpan or  search on metacpan

aap-passwd  view on Meta::CPAN


my $username = shift;
die "Invalid username\n" unless $username =~ USER_REGEX;
($username) = ($username =~ /(.*)/s);

my $passwd = prompt 'Enter new Apache2::Authen::Passphrase password: ';
my $confirm = prompt 'Retype new Apache2::Authen::Passphrase password: ';

die "Sorry, passwords do not match\n" unless $passwd eq $confirm;
pwset $username, $passwd;
say 'Password updated successfully'; ## no critic (RequireCheckedSyscalls)

__END__

=head1 NAME

aap-passwd - passwd utility for Apache2::Authen::Passphrase

=head1 SYNOPSIS

  user@hostname:~$ aap-passwd /path/to/rootdir marius
  Enter new Apache2::Authen::Passphrase password: ***
  Retype new Apache2::Authen::Passphrase password: ***
  Password updated successfully

=head1 DESCRIPTION

aap-passwd updates the password of an Apache2::Authen::Passphrase user.

It is used like this:

    aap-passwd /path/to/rootdir username

where the C<rootdir> is the first argument and the username whose password is to be changed is the second argument, or like this:



( run in 0.254 second using v1.01-cache-2.11-cpan-05444aca049 )