r4528: merge Fedora spec file fixes
[Samba.git] / examples / LDAP / smbldap-tools / smbldap-groupshow.pl
bloba9d368763ee82c5278fb6d87ff87d01f4a01ba65
1 #!/usr/bin/perl -w
3 # This code was developped by IDEALX (http://IDEALX.org/) and
4 # contributors (their names can be found in the CONTRIBUTORS file).
6 # Copyright (C) 2001-2002 IDEALX
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21 # USA.
23 # Purpose of smbldap-groupshow : user (posix,shadow,samba) display
25 # History :
26 # . originally by David Le Corfec <david.le-corfec@IDEALX.com>
28 use strict;
29 use FindBin;
30 use FindBin qw($RealBin);
31 use lib "$RealBin/";
32 use smbldap_tools;
33 use Getopt::Std;
34 my %Options;
36 my $ok = getopts('?', \%Options);
38 if ( (!$ok) || (@ARGV < 1) || ($Options{'?'}) ) {
39 print "Usage: $0 [-?] group\n";
40 print " -? show this help message\n";
41 exit (1);
44 # Read only first @ARGV
45 my $group = $ARGV[0];
47 my $lines = read_group($group);
48 if (!defined($lines)) {
49 print "$0: group $group doesn't exist\n";
50 exit (1);
53 print "$lines\n";
55 exit(0);
57 ############################################################
59 =head1 NAME
61 smbldap-groupshow.pl - Display group informations
63 =head1 SYNOPSIS
65 smbldap-groupshow.pl groupname
67 =head1 DESCRIPTION
69 The smbldap-groupshow.pl command displays informations
70 associated with the given group.
72 =cut