KILL_PYROS_DOCKER_RUN
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
# If Mac OS, execute this script FROM container (then exit !)
OS=$(uname)
#echo $OS
if [[ $OS == "Darwin" ]] ; then
#echo "Mac OS"
docker exec pyros bash docker/$0 $1
exit
fi
# to really KILL PYROS:
DOIT=1
# No KILL, just inform
#DOIT=0
[[ $1 == "no" ]] && DOIT=0
echo
echo "VOICI TOUS LES PROCESSUS LANCÉS POUR PYROS"
echo "------------------------------------------"
echo
echo "(Pour tuer complètement pyros, il faut KILL tous ces processus)"
echo
ps_process() {
echo "- Processus $1 :"
#ps -efl|grep "$1" | grep -v "grep" | sed "s/ * / /g" | cut -d " " -f 4
ps -efl|grep "$1" | grep -v "grep"
#pids=$(ps -efl|grep "$1" | grep -v "grep" | sed "s/ * / /g" | cut -d " " -f 4)
pids=$(ps -efl|grep "$1" | grep -v "grep" | sed "s/ */ /g" | cut -d " " -f 4)
for p in $pids ; do
#[ $DOIT == 1 ] && echo "kill $p"
echo "kill $p"
[ $DOIT == 1 ] && kill $p
done
echo
}
# - WEB SERVER
ps_process "pyros.py start webserver"
ps_process "manage.py runserver"
# - SIMULATORS
#ps_process plc
ps_process plcSimulator.py
ps_process telescope
# - AGENT MONITORING
#ps_process monitoring
ps_process agentM
echo
echo "VOIR AUSSI LES PROCESSUS DOCKER RESTANT... :"
DOIT=0
ps_process docker
echo
exit
# ANCIENNE VERSION
ps -efl|grep manage | grep -v "grep"
#ps -efl|grep manage | grep -v "grep" | cut -d " " -f 4
ps -efl|grep monitoring | grep -v "grep"
#ps -efl|grep start_agent_monitoring | grep -v "grep"
#ps -efl|grep start_agent_telescope_monitoring | grep -v "grep"
ps -efl|grep plc | grep -v "grep"
ps -efl|grep telescope | grep -v "grep"