equal
deleted
inserted
replaced
1 #!/usr/bin/perl |
|
2 |
|
3 # Copyright (C) 2011 Matthias Förste |
|
4 # |
|
5 # This program is free software: you can redistribute it and/or modify |
|
6 # it under the terms of the GNU General Public License as published by |
|
7 # the Free Software Foundation, either version 3 of the License, or |
|
8 # (at your option) any later version. |
|
9 # |
|
10 # This program is distributed in the hope that it will be useful, |
|
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 # GNU General Public License for more details. |
|
14 # |
|
15 # You should have received a copy of the GNU General Public License |
|
16 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
17 # |
|
18 # Matthias Förste <foerste@schlittermann.de> |
|
19 |
|
20 use strict; |
|
21 use warnings; |
|
22 |
|
23 use Getopt::Long; |
|
24 use Ius::Dav::Htpasswd qw(readconfig userdel usage); |
|
25 |
|
26 my $user; |
|
27 |
|
28 GetOptions( |
|
29 'u|user=s' => \$user, |
|
30 "h|help" => sub { usage( -verbose => 0, -exitval => 0 ) }, |
|
31 "m|man" => sub { |
|
32 usage( |
|
33 -verbose => 2, |
|
34 -exitval => 0, |
|
35 -noperldoc => ( `perldoc -V 2>/dev/null`, $? != 0 )[-1] |
|
36 ); |
|
37 }, |
|
38 ) |
|
39 and defined $user |
|
40 or usage(); |
|
41 |
|
42 exit userdel readconfig, $user; |
|