aboutsummaryrefslogtreecommitdiffstats
path: root/add-group
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-07-31 08:47:00 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-07-31 08:47:00 +0000
commit3697c040b676e2d32338159c27289877a7af853e (patch)
tree6fbcb16917dbd0e59b4046dd50e6f1418b40fd0b /add-group
parent4f395d8a776bbc33656edbd6c2927115da8736d3 (diff)
downloadrpm-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
Diffstat (limited to 'add-group')
-rwxr-xr-xadd-group18
1 files changed, 10 insertions, 8 deletions
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