16 lines
385 B
Bash
16 lines
385 B
Bash
#!/bin/bash
|
|
|
|
# Première version
|
|
ip=$1
|
|
user=root
|
|
workdir=/root/deploy
|
|
|
|
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 $user@$ip "rm -R $workdir" |