siotp/sisr1/tp04-scripts-admin/deployUsers.sh
2025-03-24 09:23:59 +01:00

16 lines
347 B
Bash

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