diff options
author | Guillaume Rousse <guillomovitch@mandriva.org> | 2009-03-29 17:54:26 +0000 |
---|---|---|
committer | Guillaume Rousse <guillomovitch@mandriva.org> | 2009-03-29 17:54:26 +0000 |
commit | d7e965af2545b4a3783b652d15fb74b4abca662b (patch) | |
tree | 3f80d5199eb062eb18b4262fac8646325560c640 /add-user | |
parent | 0fc0ce3e353bba96cb46d1589a3cf1cc2f932209 (diff) | |
download | rpm-helper-d7e965af2545b4a3783b652d15fb74b4abca662b.tar rpm-helper-d7e965af2545b4a3783b652d15fb74b4abca662b.tar.gz rpm-helper-d7e965af2545b4a3783b652d15fb74b4abca662b.tar.bz2 rpm-helper-d7e965af2545b4a3783b652d15fb74b4abca662b.tar.xz rpm-helper-d7e965af2545b4a3783b652d15fb74b4abca662b.zip |
only add user or group if not already existing
Diffstat (limited to 'add-user')
-rwxr-xr-x | add-user | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -21,7 +21,10 @@ name=$3 # name of the user dir=$4 # home directory shell=$5 # shell -/usr/sbin/useradd -r -M -s $shell -d $dir -c "system user for $pkg" $name > /dev/null +if ! id $name /dev/null 2>&1; then + /usr/sbin/useradd -r -M \ + -s $shell -d $dir -c "system user for $pkg" $name > /dev/null +fi exit 0 |