diff --git a/sisr1/tp04_scripts_admin/createGroups.sh b/sisr1/tp04_scripts_admin/createGroups.sh index f400c82..7126b18 100644 --- a/sisr1/tp04_scripts_admin/createGroups.sh +++ b/sisr1/tp04_scripts_admin/createGroups.sh @@ -6,23 +6,26 @@ while read ligne do # A chaque itération, stocker le métier dans $metier metier=$(echo $ligne | cut -d "," -f5) + # On regarde si les group existe - tail /etc/group + # tail /etc/group + # Vérification de la présence du groupe Accountant -> ajout de la fonction "Accountant" à $groups - if [[ $(echo $line | grep "Accountant") == "" ]] ; then + if [[ $(echo $ligne | grep "Accountant") == "" ]] ; then groupadd accountant fi # Vérification de la présence du groupe Management -> ajout de la fonction "Management" à $groups - if [[ $(echo $line | grep "Management") == "" ]] ; then + if [[ $(echo $ligne | grep "Management") == "" ]] ; then groupadd management fi # Vérification de la présence du groupe Production -> ajout de la fonction "Production" à $groups - if [[ $(echo $line | grep "Production") == "" ]] ; then + if [[ $(echo $ligne | grep "Production") == "" ]] ; then groupadd production fi + # On regarde si les groups ont été créé - tail /etc/group + # tail /etc/group # echo $metier done < $file \ No newline at end of file