From 295c5cfe6f59d415b9432d953f45bad88dc76fe1 Mon Sep 17 00:00:00 2001 From: "elio.lafourcade" Date: Thu, 20 Mar 2025 14:42:01 +0100 Subject: [PATCH] gitpush --- .../srv-admin/interfaces | 0 .../srv-admin/nat.sh | 0 .../srv-service/db.monlabo.lan | 0 .../srv-service/db.monlabo.lan.rev | 0 .../srv-service/dhcpd.conf | 0 .../srv-service/named.conf | 0 .../srv-service/named.conf.local | 0 .../srv-service/named.conf.options | 0 sisr1/tp04-scripts-admin/Users.csv | 30 +++++++++++++++++++ sisr1/tp04-scripts-admin/createGroups.sh | 12 ++++++++ sisr1/tp04-scripts-admin/createLogin.sh | 25 ++++++++++++++++ sisr1/tp04-scripts-admin/createUser.sh | 27 +++++++++++++++++ sisr1/tp04-scripts-admin/gitpush.sh | 5 ++++ sisr1/tp04-scripts-admin/login.csv | 0 14 files changed, 99 insertions(+) rename sisr1/{tp03 => tp03-reseau-prive}/srv-admin/interfaces (100%) rename sisr1/{tp03 => tp03-reseau-prive}/srv-admin/nat.sh (100%) rename sisr1/{tp03 => tp03-reseau-prive}/srv-service/db.monlabo.lan (100%) rename sisr1/{tp03 => tp03-reseau-prive}/srv-service/db.monlabo.lan.rev (100%) rename sisr1/{tp03 => tp03-reseau-prive}/srv-service/dhcpd.conf (100%) rename sisr1/{tp03 => tp03-reseau-prive}/srv-service/named.conf (100%) rename sisr1/{tp03 => tp03-reseau-prive}/srv-service/named.conf.local (100%) rename sisr1/{tp03 => tp03-reseau-prive}/srv-service/named.conf.options (100%) create mode 100644 sisr1/tp04-scripts-admin/Users.csv create mode 100644 sisr1/tp04-scripts-admin/createGroups.sh create mode 100644 sisr1/tp04-scripts-admin/createLogin.sh create mode 100644 sisr1/tp04-scripts-admin/createUser.sh create mode 100644 sisr1/tp04-scripts-admin/gitpush.sh create mode 100644 sisr1/tp04-scripts-admin/login.csv diff --git a/sisr1/tp03/srv-admin/interfaces b/sisr1/tp03-reseau-prive/srv-admin/interfaces similarity index 100% rename from sisr1/tp03/srv-admin/interfaces rename to sisr1/tp03-reseau-prive/srv-admin/interfaces diff --git a/sisr1/tp03/srv-admin/nat.sh b/sisr1/tp03-reseau-prive/srv-admin/nat.sh similarity index 100% rename from sisr1/tp03/srv-admin/nat.sh rename to sisr1/tp03-reseau-prive/srv-admin/nat.sh diff --git a/sisr1/tp03/srv-service/db.monlabo.lan b/sisr1/tp03-reseau-prive/srv-service/db.monlabo.lan similarity index 100% rename from sisr1/tp03/srv-service/db.monlabo.lan rename to sisr1/tp03-reseau-prive/srv-service/db.monlabo.lan diff --git a/sisr1/tp03/srv-service/db.monlabo.lan.rev b/sisr1/tp03-reseau-prive/srv-service/db.monlabo.lan.rev similarity index 100% rename from sisr1/tp03/srv-service/db.monlabo.lan.rev rename to sisr1/tp03-reseau-prive/srv-service/db.monlabo.lan.rev diff --git a/sisr1/tp03/srv-service/dhcpd.conf b/sisr1/tp03-reseau-prive/srv-service/dhcpd.conf similarity index 100% rename from sisr1/tp03/srv-service/dhcpd.conf rename to sisr1/tp03-reseau-prive/srv-service/dhcpd.conf diff --git a/sisr1/tp03/srv-service/named.conf b/sisr1/tp03-reseau-prive/srv-service/named.conf similarity index 100% rename from sisr1/tp03/srv-service/named.conf rename to sisr1/tp03-reseau-prive/srv-service/named.conf diff --git a/sisr1/tp03/srv-service/named.conf.local b/sisr1/tp03-reseau-prive/srv-service/named.conf.local similarity index 100% rename from sisr1/tp03/srv-service/named.conf.local rename to sisr1/tp03-reseau-prive/srv-service/named.conf.local diff --git a/sisr1/tp03/srv-service/named.conf.options b/sisr1/tp03-reseau-prive/srv-service/named.conf.options similarity index 100% rename from sisr1/tp03/srv-service/named.conf.options rename to sisr1/tp03-reseau-prive/srv-service/named.conf.options diff --git a/sisr1/tp04-scripts-admin/Users.csv b/sisr1/tp04-scripts-admin/Users.csv new file mode 100644 index 0000000..9dfb324 --- /dev/null +++ b/sisr1/tp04-scripts-admin/Users.csv @@ -0,0 +1,30 @@ +Ermengarde,Berthelmot,eberthelmot0@webmd.com,Female,Accountant, +Kassi,Bunker,kbunker1@xinhuanet.com,Female,Production, +Moises,McCallum,mmccallum2@i2i.jp,Male,Production, +Patrizio,Lune,plune3@upenn.edu,Male,Accountant, +Blanch,Everix,beverix4@php.net,Female,Accountant, +Stafani,Kibbel,skibbel5@marriott.com,Female,Production, +Ignacius,Mosdell,imosdell6@cloudflare.com,Male,Management, +Jeana,Waller-Bridge,jwallerbridge7@mapy.cz,Female,Management, +Elroy,Dressel,edressel8@opera.com,Male,Production, +Thea,Strettell,tstrettell9@nature.com,Female,Production, +Solomon,Insoll,sinsolla@utexas.edu,Male,Accountant, +Carri,Feedome,cfeedomeb@ask.com,Female,Accountant, +Padraic,Chetwind,pchetwindc@last.fm,Male,Management, +Solly,D'Ugo,sdugod@uiuc.edu,Male,Production, +Konstanze,MacCostigan,kmaccostigane@seattletimes.com,Female,Accountant, +Roxane,Powlesland,rpowleslandf@pcworld.com,Female,Management, +Orelle,Kennealy,okennealyg@arstechnica.com,Female,Production, +Sukey,Soitoux,ssoitouxh@shinystat.com,Female,Production, +Nelli,Syce,nsycei@blogger.com,Female,Production, +Clarisse,Shillam,cshillamj@dailymotion.com,Female,Production, +Carin,Gueny,cguenyk@naver.com,Female,Management, +Donny,Riepel,driepell@addtoany.com,Male,Production, +Daniella,Ralfe,dralfem@wunderground.com,Female,Production, +Lexy,Clynmans,lclynmansn@furl.net,Female,Production, +Gardiner,Adamthwaite,gadamthwaiteo@spotify.com,Male,Production, +Woodman,Lippett,wlippettp@purevolume.com,Male,Production, +Nadya,Munnion,nmunnionq@flavors.me,Female,Production, +Llewellyn,Habershon,lhabershonr@alibaba.com,Male,Production, +Isaak,Greatrex,igreatrexs@seesaa.net,Male,Production, +Darill,Frostdyke,dfrostdyket@cafepress.com,Male,Production, diff --git a/sisr1/tp04-scripts-admin/createGroups.sh b/sisr1/tp04-scripts-admin/createGroups.sh new file mode 100644 index 0000000..5f5bed0 --- /dev/null +++ b/sisr1/tp04-scripts-admin/createGroups.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) # A chaque itération, stocker le métier dans $metier + if [[ $(echo $user_line | grep $metier /etc/group) == "" ]] ; then + groupadd $metier +fi + + echo $metier +done < $fichier \ No newline at end of file diff --git a/sisr1/tp04-scripts-admin/createLogin.sh b/sisr1/tp04-scripts-admin/createLogin.sh new file mode 100644 index 0000000..c5f161d --- /dev/null +++ b/sisr1/tp04-scripts-admin/createLogin.sh @@ -0,0 +1,25 @@ +#!/bin/bash +fichier_a_lire=./Users.csv +fichier_a_ecrire=./login.csv #creation du fichier alire +stockage dans cette variable +rm $fichier_a_ecrire 2> /dev/null #supprimer le fichier avant dexcuter le scripts +touch $fichier_a_ecrire + + + + +while read line #définit la variable "ligne" comme le contenu de la ligne du fichier en cours de lecture +do + aecrire=" " + last_name=$(echo $ligne | cut -d "," -f2) + first_name=$(echo $ligne | cut -d "," -f1) + login=$(echo $first_name| cut -c1)$last_name + login=$(echo $login | tr [:upper:] [:lower:]) + login=$(echo $login | tr -dc [:alnum:]) + password=$(tr -dc '12345!@#$%^&*()_A-Z-a-z-0-9'> $fichier_a_ecrire + done < $fichier_a_lire diff --git a/sisr1/tp04-scripts-admin/createUser.sh b/sisr1/tp04-scripts-admin/createUser.sh new file mode 100644 index 0000000..7b3a7e3 --- /dev/null +++ b/sisr1/tp04-scripts-admin/createUser.sh @@ -0,0 +1,27 @@ +#!/bin/bash +fichier_a_lire=./login.csv + + + + +while read ligne #définit la variable "ligne" comme le contenu de la ligne du fichier en cours de lecture +do + username=$(echo $ligne | cut -d ";" -f1) + usseradd -m -s "/bin/bash" $username + + + + + group=$(echo $ligne | cut -d "," -f5) + usermod -aG $group $username + + + passwd=$(echo $ligne | cut -d ";" -f2) + + + echo $username:$passwd | chpasswd + + + chown $username:$username /home/$username + + done < $fichier diff --git a/sisr1/tp04-scripts-admin/gitpush.sh b/sisr1/tp04-scripts-admin/gitpush.sh new file mode 100644 index 0000000..cd33129 --- /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://elio.lafourcade@gitea.lyc-lecastel.fr/elio.lafourcade/siotp.git \ No newline at end of file diff --git a/sisr1/tp04-scripts-admin/login.csv b/sisr1/tp04-scripts-admin/login.csv new file mode 100644 index 0000000..e69de29