[csw-devel] SF.net SVN: gar:[14492] csw/mgar/pkg/cswclassutils/trunk/files/ CSWcswclassutils.i.cswusergroup
bdwalton at users.sourceforge.net
bdwalton at users.sourceforge.net
Mon May 2 21:49:45 CEST 2011
Revision: 14492
http://gar.svn.sourceforge.net/gar/?rev=14492&view=rev
Author: bdwalton
Date: 2011-05-02 19:49:44 +0000 (Mon, 02 May 2011)
Log Message:
-----------
cswclassutils/trunk: add auxgroups field to cswusergroup; mantis id 3861
Modified Paths:
--------------
csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswusergroup
Modified: csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswusergroup
===================================================================
--- csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswusergroup 2011-05-02 18:55:37 UTC (rev 14491)
+++ csw/mgar/pkg/cswclassutils/trunk/files/CSWcswclassutils.i.cswusergroup 2011-05-02 19:49:44 UTC (rev 14492)
@@ -5,8 +5,10 @@
# $Id$
#
# Written by Peter Bonivart
+# Modified by Ben Walton
#
# 2009-02-10 First release
+# 2011-04-29 Add support for auxgroups
#
# Documentation: http://wiki.opencsw.org/cswclassutils-package
#
@@ -171,6 +173,7 @@
shell="$5"
create="$6"
nopass="$7"
+ auxgroups="$8"
if getent passwd $user > /dev/null; then
echo User $user already exists
@@ -186,10 +189,11 @@
[ -n "$dir" ] && dir="-d $dir"
[ -n "$shell" ] && shell="-s $shell"
[ -n "$create" ] && create="-m"
+ [ -n "$auxgroups" ] && auxgroups="-G $auxgroups"
- debug_echo "/usr/sbin/useradd -g $uid $gcos $group $create $dir $shell $user"
+ debug_echo "/usr/sbin/useradd -g $uid $gcos $group $auxgroups $create $dir $shell $user"
if /usr/sbin/useradd \
- -u $uid $gcos $group $create $dir $shell $user > /dev/null
+ -u $uid $gcos $group $auxgroups $create $dir $shell $user > /dev/null
then
echo User $user has been added
else
@@ -253,6 +257,7 @@
shell=`echo $i | awk -F':' '{print $5}'`
create=`echo $i | awk -F':' '{print $6}'`
nopass=`echo $i | awk -F':' '{print $8}'`
+ auxgroups=`echo $i | awk -F':' '{print $9}'`
if [ -n "$group" ]; then
create_group $group
@@ -262,7 +267,7 @@
if [ -n "$user" ]; then
create_user \
- "$user" "$group" "$gcos" "$dir" "$shell" "$create" "$nopass"
+ "$user" "$group" "$gcos" "$dir" "$shell" "$create" "$nopass" "$auxgroups"
else
echo No user to create
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list