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
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"
ssh $user@$ip "rm -R $workdir"