From a02671ecaefa497089e038d5118503ddc7d680be Mon Sep 17 00:00:00 2001 From: "jeremy.thomas" Date: Mon, 17 Feb 2025 11:52:29 +0100 Subject: [PATCH] =?UTF-8?q?Premi=C3=A8re=20version=20pour=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sisr1/tp04_scripts_admin/createGroups.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sisr1/tp04_scripts_admin/createGroups.sh b/sisr1/tp04_scripts_admin/createGroups.sh index fb0c238..ab9f020 100644 --- a/sisr1/tp04_scripts_admin/createGroups.sh +++ b/sisr1/tp04_scripts_admin/createGroups.sh @@ -7,23 +7,17 @@ do # A chaque itération, stocker le métier dans $metier metier=$(echo $ligne | cut -d "," -f5) # Vérification de la présence du groupe Accountant -> ajout de la fonction "Accountant" à $groups - if [[ $(echo $line | grep "Accountant") != "" ]] ; then - echo "Le groupe est déjà créé" - else ; + if [[ $(echo $line | 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 - echo "Le groupe est déjà créé" - else ; + if [[ $(echo $line | 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 - echo "Le groupe est déjà créé" - else ; + if [[ $(echo $line | grep "Production") == "" ]] ; then groupadd production fi echo $metier