cfidhe
This commit is contained in:
parent
b82a4e04cc
commit
84affee441
@ -0,0 +1,18 @@
|
|||||||
|
#!/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"
|
14
sisr1/tp04_scripts_admin/script.sh
Normal file
14
sisr1/tp04_scripts_admin/script.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
filename=squid.conf #nom du fichier à récuperer
|
||||||
|
filepath=/etc/squid #chemin
|
||||||
|
servicename=squid.service #nom du service
|
||||||
|
|
||||||
|
|
||||||
|
git pull #mise a jour du depot distant
|
||||||
|
|
||||||
|
sudo cp $filepath/$filename $filepath/$filename.old #sauvegarde en changeant le nom .old
|
||||||
|
|
||||||
|
sudo cp ./$filename $filepath/$filename
|
||||||
|
|
||||||
|
sudo systemctl restart $servicename #restart le service
|
Loading…
x
Reference in New Issue
Block a user