Ajout_de_la_correction_du_script_deployUsers.sh

This commit is contained in:
jeremy.thomas 2025-03-24 09:01:03 +01:00
parent 6ca17c0f88
commit 56f177323f

View File

@ -2,12 +2,15 @@
# Première version # Première version
ip=$1 ip=$1
user=root
workdir=/root/deploy workdir=/root/deploy
ssh root@$ip "mkdir $workdir" 2> /dev/null ssh $user@$ip "mkdir $workdir" 2> /dev/null
scp "./createGroups.sh" "./logins.csv" "./createUsers.sh" root@$ip:$workdir # Copie des scripts et fichiers
ssh root@$ip >> EOF scp "./createGroups.sh" "./logins.csv" "./Users.csv" "./createUsers.sh" $user@$ip:$workdir
bash createGroups.sh # Exécution les scripts
bash createUsers.sh ssh $user@$ip >> EOF
bash $workdir/createGroups.sh
bash $workdir/createUsers.sh
EOF EOF
ssh root@$ip "rm -R $workdir" ssh $user@$ip "rm -R $workdir"