diff options
author | Frederic Lepied <flepied@mandriva.com> | 2002-07-31 08:47:00 +0000 |
---|---|---|
committer | Frederic Lepied <flepied@mandriva.com> | 2002-07-31 08:47:00 +0000 |
commit | 3697c040b676e2d32338159c27289877a7af853e (patch) | |
tree | 6fbcb16917dbd0e59b4046dd50e6f1418b40fd0b | |
parent | 4f395d8a776bbc33656edbd6c2927115da8736d3 (diff) | |
download | rpm-helper-3697c040b676e2d32338159c27289877a7af853e.tar rpm-helper-3697c040b676e2d32338159c27289877a7af853e.tar.gz rpm-helper-3697c040b676e2d32338159c27289877a7af853e.tar.bz2 rpm-helper-3697c040b676e2d32338159c27289877a7af853e.tar.xz rpm-helper-3697c040b676e2d32338159c27289877a7af853e.zip |
corrected group add without a user to add
-rwxr-xr-x | add-group | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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 |