From 590b88c3fd662dedb2eb7bfdcccc2157e1e954f2 Mon Sep 17 00:00:00 2001 From: "charlie.alves" Date: Wed, 19 Feb 2025 17:27:40 +0100 Subject: [PATCH] jjb --- sisr1/tp04-scripts-admin/createLogins.sh | 12 ++++++++++++ sisr1/tp04-scripts-admin/gitpush.sh | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 sisr1/tp04-scripts-admin/createLogins.sh create mode 100644 sisr1/tp04-scripts-admin/gitpush.sh diff --git a/sisr1/tp04-scripts-admin/createLogins.sh b/sisr1/tp04-scripts-admin/createLogins.sh new file mode 100644 index 0000000..fe1f567 --- /dev/null +++ b/sisr1/tp04-scripts-admin/createLogins.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +fichier="./Users.csv" + +while read ligne #définit la variable "ligne" comme le contenu de la ligne du fichier en cours de lecture +do + metier=$(echo $ligne | cut -d "," -f5) + if [[ $(grep $metier /etc/group) == "" ]] ; then + groupadd $metier + fi + +done < $fichier \ No newline at end of file diff --git a/sisr1/tp04-scripts-admin/gitpush.sh b/sisr1/tp04-scripts-admin/gitpush.sh new file mode 100644 index 0000000..9b9a883 --- /dev/null +++ b/sisr1/tp04-scripts-admin/gitpush.sh @@ -0,0 +1,5 @@ +#!/bin/bash +message=$1 +git add . +git commit -m "$message" +git push -u https://charlie.alves@gitea.lyc-lecastel.fr/charlie.alves/siotp.git \ No newline at end of file