]> gitweb.pimeys.fr Git - scripts-20-100.git/blob - all_bots
[bind_ftp] Dossier spécifique pour l'Upload sur zeldren
[scripts-20-100.git] / all_bots
1 #!/bin/bash
2
3 # Pour envoyer une instructions à tous les bots en même temps
4
5 bots=('basile' 'deconnaisseur' 'hung' 'historien' 'salesman' 'saturnin' 'themis' 'parrot') # 'ibot')
6
7 cmd=$1
8 case $cmd in
9 kill)
10 echo "Warning, killing all processes of users : ${bots[*]}"
11 for bot in ${bots[*]}
12 do
13 sudo pkill -u $bot
14 done
15 ;;
16 start|stop|restart|reload)
17 for bot in ${bots[*]}
18 do
19 sudo service $bot $cmd
20 done
21 ;;
22 status)
23 for bot in ${bots[*]}
24 do
25 service $bot $cmd
26 done
27 ;;
28 update|pull|maj)
29 for bot in ${bots[*]}
30 do
31 cd /home/$bot/$bot
32 sudo -u $bot git pull
33 done
34 ;;
35 list|who)
36 echo "Liste des bots : ${bots[*]}"
37 ;;
38 *)
39 echo "Usage: all_bots {kill|start|stop|reload|restart|update|status}"
40 ;;
41 esac