From 84affee4419e37a5d682c472dc8c6f2aa38a4848 Mon Sep 17 00:00:00 2001 From: Tom Guerin Date: Mon, 24 Mar 2025 09:25:57 +0100 Subject: [PATCH] cfidhe --- sisr1/tp04_scripts_admin/deployUsers.sh | 18 ++++++++++++++++++ sisr1/tp04_scripts_admin/script.sh | 14 ++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 sisr1/tp04_scripts_admin/script.sh diff --git a/sisr1/tp04_scripts_admin/deployUsers.sh b/sisr1/tp04_scripts_admin/deployUsers.sh index e69de29..4c00071 100644 --- a/sisr1/tp04_scripts_admin/deployUsers.sh +++ b/sisr1/tp04_scripts_admin/deployUsers.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +ip=$1 + +chemin=/root/deploy +user=root + +ssh $user@$ip "mkdir $chemin" 2> /dev/null + +scp createGroups.sh $user@$ip:$chemin +scp createUser.sh $user@$ip:$chemin +scp logins.csv $user@$ip:$chemin +scp Users.csv $user@$ip:$chemin + +ssh $user@$ip "cd $chemin bash createGroups.sh ; bash createUsers.sh" + + +ssh $user@$ip "rm -R $chemin" \ No newline at end of file diff --git a/sisr1/tp04_scripts_admin/script.sh b/sisr1/tp04_scripts_admin/script.sh new file mode 100644 index 0000000..8050ee3 --- /dev/null +++ b/sisr1/tp04_scripts_admin/script.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +filename=squid.conf #nom du fichier à récuperer +filepath=/etc/squid #chemin +servicename=squid.service #nom du service + + +git pull #mise a jour du depot distant + +sudo cp $filepath/$filename $filepath/$filename.old #sauvegarde en changeant le nom .old + +sudo cp ./$filename $filepath/$filename + +sudo systemctl restart $servicename #restart le service \ No newline at end of file