2025-03-24 09:06:31 +01:00

19 lines
430 B
Bash

#!/bin/bash
ip=$1
user=root
workdir=/$user/deploy
ssh $user@$ip "mkdir $workdir" 2> /dev/null
#copie des scripts et fichier
scp createGroups.sh $user@$ip:$workdir
scp createUsers.sh $user@$ip:$workdir
scp login.csv $user@$ip:$workdir
scp Users.csv $user@$ip:$workdir
#execution des scripts
ssh $user@$ip "bash $workdir/createGroups.sh"
ssh $user@$ip "bash $workdir/createUsers.sh"
ssh $user@$ip "rm -R $workdir" #suppression