From 34a518f221ec7da09db3c2ac62a0ac404cdf82f6 Mon Sep 17 00:00:00 2001 From: "charlie.alves" Date: Mon, 24 Mar 2025 09:23:59 +0100 Subject: [PATCH] suite des tp --- sisr1/tp04-scripts-admin/deployUsers.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sisr1/tp04-scripts-admin/deployUsers.sh diff --git a/sisr1/tp04-scripts-admin/deployUsers.sh b/sisr1/tp04-scripts-admin/deployUsers.sh new file mode 100644 index 0000000..2e78bdf --- /dev/null +++ b/sisr1/tp04-scripts-admin/deployUsers.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +ip=$1 +workdir=/root/deploy +user=root + +ssh $user@$ip "mkdir $workdir" 2> /dev/null + +scp createGroups.sh $user@$ip:$workdir +scp logins.csv $user@$ip:$workdir +scp createUsers.sh $user@$ip:$workdir +scp Users.csv $user@$ip:$workdir + +ssh $user@$ip "cd $workdir ; bash createGroups.sh ; bash createUsers.sh" + +ssh $user@$ip "rm -R $workdir" \ No newline at end of file