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