3 # $Id: smbldap-groupdel,v 1.7 2004/11/06 17:54:26 jtournier Exp $
5 # This code was developped by IDEALX (http://IDEALX.org/) and
6 # contributors (their names can be found in the CONTRIBUTORS file).
8 # Copyright (C) 2001-2002 IDEALX
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License
12 # as published by the Free Software Foundation; either version 2
13 # of the License, or (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25 # Purpose of smbldap-groupdel : group (posix) deletion
29 use FindBin qw($RealBin);
37 my $ok = getopts('?', \%Options);
38 if ( (!$ok) || (@ARGV < 1) || ($Options{'?'}) ) {
40 print "Usage: $0 groupname\n";
41 print " -? show this help message\n";
45 my $_groupName = $ARGV[0];
47 my $ldap_master=connect_ldap_master();
50 if (!defined($dn_line = get_group_dn($_groupName))) {
51 print "$0: group $_groupName doesn't exist\n";
55 my $dn = get_dn_from_line($dn_line);
59 my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1";
61 if ($nscd_status == 0) {
62 system "/etc/init.d/nscd restart > /dev/null 2>&1";
65 #if (defined($dn_line = get_group_dn($_groupName))) {
66 # print "$0: failed to delete group\n";
76 ############################################################
80 smbldap-groupdel - Delete a group
84 smbldap-groupdel group
88 The smbldap-groupdel command modifies the system account files,
89 deleting all entries that refer to a group.
90 The named group must exist.
92 You must manually check all filesystems to insure that no files remain
93 with the named group as the file group ID.