21 lines
357 B
Bash

file=./login.csv
while read ligne
do
username=$(echo $ligne | cut -d ";" -f1)
useradd -m -s "/bin/bash" $username
group=$(echo $ligne | cut -d ";" -f5)
usermod -aG $group $username
password=$(echo $ligne | cut -d ";" -f2)
echo $username:$password | chpasswd
chown $username:$username /hom/$username
done <$fichier