From 3697c040b676e2d32338159c27289877a7af853e Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Wed, 31 Jul 2002 08:47:00 +0000 Subject: corrected group add without a user to add --- add-group | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'add-group') diff --git a/add-group b/add-group index add2213..c27855c 100755 --- a/add-group +++ b/add-group @@ -20,16 +20,18 @@ num=$2 # number of packages installed name=$3 # name of the group users=$4 # users to add to this group -SAVED_IFS="$IFS" -export IFS="$IFS", -set $users -IFS="$SAVED_IFS" - /usr/sbin/groupadd -r $name > /dev/null 2>&1 -for u in $*; do - /usr/sbin/usermod -G $name $u > /dev/null 2>&1 -done +if [ -n "$users" ]; then + SAVED_IFS="$IFS" + export IFS="$IFS", + set $users + IFS="$SAVED_IFS" + + for u in $*; do + /usr/sbin/usermod -G $name $u > /dev/null 2>&1 + done +fi exit 0 -- cgit v1.2.1