Magellan Linux

Annotation of /branches/mage-next/src/helper/mgroupdel.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 78 - (hide annotations) (download)
Wed Jun 1 15:48:52 2005 UTC (18 years, 11 months ago) by niro
Original Path: trunk/mage/usr/lib/mage/mgroupdel
File size: 688 byte(s)
changed version tagging only

1 niro 42 #!/bin/bash
2 niro 78 # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mgroupdel,v 1.4 2005-06-01 15:48:40 niro Exp $
3 niro 42
4     print_usage()
5     {
6     echo "$(basename $0 .sh) deletes users from /etc/group."
7     echo " USAGE: $(basename $0 .sh) GROUP_NAME .."
8     echo
9     echo " Examples:"
10     echo " $(basename $0 .sh) sshd"
11     echo
12     }
13    
14     #exit if $1 is zero
15     if [ -z "$1" ]
16     then
17     print_usage
18     exit 1
19     fi
20    
21     GROUP_TO_DEL="$1"
22    
23     #start nscd to cache /etc/group
24     $(which nscd) -i group
25     # get the info
26     my_user="$(getent group ${GROUP_TO_DEL})"
27    
28     if [ -z "${my_user}" ]
29     then
30     echo " User '${GROUP_TO_DEL}' already deleted ..."
31     else
32     echo " Deleting user '${GROUP_TO_DEL}' ..."
33     groupdel "${GROUP_TO_DEL}"
34     fi