deployUsers
This commit is contained in:
parent
43bdebdec9
commit
7408f2afd4
19
sisr1/TP04-Bases-d'administration/deployUsers.sh
Normal file
19
sisr1/TP04-Bases-d'administration/deployUsers.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/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
|
@ -13,4 +13,4 @@ git add .
|
|||||||
git commit -m "$message"
|
git commit -m "$message"
|
||||||
|
|
||||||
# Push vers le dépot
|
# Push vers le dépot
|
||||||
git push -u https://redouane.assani@gitea.lyc-lecastel.fr/redouane.assani/siotp.git
|
git push https://redouane.assani@gitea.lyc-lecastel.fr/redouane.assani/siotp.git
|
Loading…
x
Reference in New Issue
Block a user