siotp/sisr1/tp04_scripts_admin/deployUsers.sh
Tom Guerin 84affee441 cfidhe
2025-03-24 09:25:57 +01:00

18 lines
336 B
Bash

#!/bin/bash
ip=$1
chemin=/root/deploy
user=root
ssh $user@$ip "mkdir $chemin" 2> /dev/null
scp createGroups.sh $user@$ip:$chemin
scp createUser.sh $user@$ip:$chemin
scp logins.csv $user@$ip:$chemin
scp Users.csv $user@$ip:$chemin
ssh $user@$ip "cd $chemin bash createGroups.sh ; bash createUsers.sh"
ssh $user@$ip "rm -R $chemin"