From 56f177323fd1a5496db0acead26c05b4cfb9a9a4 Mon Sep 17 00:00:00 2001 From: "jeremy.thomas" Date: Mon, 24 Mar 2025 09:01:03 +0100 Subject: [PATCH] Ajout_de_la_correction_du_script_deployUsers.sh --- sisr1/tp04_scripts_admin/deployUsers.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sisr1/tp04_scripts_admin/deployUsers.sh b/sisr1/tp04_scripts_admin/deployUsers.sh index e42a821..0196e47 100644 --- a/sisr1/tp04_scripts_admin/deployUsers.sh +++ b/sisr1/tp04_scripts_admin/deployUsers.sh @@ -2,12 +2,15 @@ # Première version ip=$1 +user=root workdir=/root/deploy -ssh root@$ip "mkdir $workdir" 2> /dev/null -scp "./createGroups.sh" "./logins.csv" "./createUsers.sh" root@$ip:$workdir -ssh root@$ip >> EOF - bash createGroups.sh - bash createUsers.sh +ssh $user@$ip "mkdir $workdir" 2> /dev/null +# Copie des scripts et fichiers +scp "./createGroups.sh" "./logins.csv" "./Users.csv" "./createUsers.sh" $user@$ip:$workdir +# Exécution les scripts +ssh $user@$ip >> EOF + bash $workdir/createGroups.sh + bash $workdir/createUsers.sh EOF -ssh root@$ip "rm -R $workdir" \ No newline at end of file +ssh $user@$ip "rm -R $workdir" \ No newline at end of file