diff options
author | Frederic Lepied <flepied@mandriva.com> | 2002-12-22 23:08:41 +0000 |
---|---|---|
committer | Frederic Lepied <flepied@mandriva.com> | 2002-12-22 23:08:41 +0000 |
commit | 8a832b7dab615a128aeba158adff29e4e30ee41e (patch) | |
tree | 3945b631015df35998b6a0711ecf486a84924bbf /add-group | |
parent | 48eb5505dc5d8d8c79e6b5f8dca0d19a7d6265d4 (diff) | |
download | rpm-helper-8a832b7dab615a128aeba158adff29e4e30ee41e.tar rpm-helper-8a832b7dab615a128aeba158adff29e4e30ee41e.tar.gz rpm-helper-8a832b7dab615a128aeba158adff29e4e30ee41e.tar.bz2 rpm-helper-8a832b7dab615a128aeba158adff29e4e30ee41e.tar.xz rpm-helper-8a832b7dab615a128aeba158adff29e4e30ee41e.zip |
do not delete supplementary groups already added
Diffstat (limited to 'add-group')
-rwxr-xr-x | add-group | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -29,7 +29,11 @@ if [ -n "$users" ]; then IFS="$SAVED_IFS" for u in $*; do - /usr/sbin/usermod -G $name $u > /dev/null 2>&1 + old=`egrep "[:,]$u(,|$)" /etc/group | cut -d : -f 1 | xargs echo` + if [ -n "$old" ]; then + old=`echo ",$old" | sed 's/ /,/g'` + fi + /usr/sbin/usermod -G $name$old $u > /dev/null 2>&1 done fi |