123456789101112131415161718 |
- #!/bin/bash
- test -f /etc/users.list || exit 0
- while read id username hash groups; do
-
- grep ^$username /etc/passwd && continue
-
- addgroup --gid $id $username
-
- useradd -m -u $id -s /bin/bash -g $username $username
-
- echo "$username:$hash" | /usr/sbin/chpasswd -e
-
- if [ $groups ]; then
- usermod -aG $groups $username
- fi
- done < /etc/users.list
|