siotp/sisr1/tp04_scripts_admin/deployUsers.sh
2025-03-24 09:41:33 +01:00

18 lines
339 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 createUsers.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"