Blame view

docker/PYROS_DOCKER_RUN 1.53 KB
e64cdd09   ALEXIS-PC\alexis   improving check a...
1
#!/usr/bin/env bash
e1e75163   Alexis Koralewski   fixing issue with...
2
3

#if no container is running
e64cdd09   ALEXIS-PC\alexis   improving check a...
4
if ! [ $(docker ps | grep 'pyros' | wc -l) -eq 2 ]
e1e75163   Alexis Koralewski   fixing issue with...
5
then
da7c081d   Alexis Koralewski   remove extension ...
6
    echo "db_pyros or pyros weren't running, starting them..."
e1e75163   Alexis Koralewski   fixing issue with...
7
8
    ./PYROS_DOCKER_START.bat
fi
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
9
10
11
12
13

# 1) Web server
# - Display log on current terminal
#docker exec -it pyros python3 pyros.py start webserver $@
# - Save log in file
0e02606c   Etienne Pallier   Changed version n...
14
#docker exec pyros python3 pyros.py start webserver $@ > ../../LOG_PYROS_webserver.log 2>&1 &
6c09a2b2   Etienne Pallier   update PYROS_DOCK...
15
docker exec pyros python3 pyros.py start -o tnc webserver > ../../LOG_PYROS_webserver.log 2>&1 &
a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
16

085e388b   Etienne Pallier   added option web ...
17
18
19
20
21
22
# exit if webserver only
#[[ $1 == "web" ]] && exit

# Go on only if not "web"
if [[ $1 != "web" ]] ; then

a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
23
24
25
26
27
28
29
30
31
32
33
34
# 2) PLC simulator
# - Display log on current terminal
#docker exec -it pyros bash -c "cd simulators/plc/ ; ./plcSimulator.py"
# - Save log in file
docker exec pyros bash -c "cd simulators/plc/ ; ./plcSimulator.py" > ../../LOG_PYROS_plc_simulator.log 2>&1 &

# 3) Agent Monitoring (AgentM)
# - Display log on current terminal
#docker exec -it pyros python3 pyros.py start agentM
# - Save log in file
docker exec pyros python3 pyros.py start agentM > ../../LOG_PYROS_agent_monitoring.log 2>&1 &

085e388b   Etienne Pallier   added option web ...
35
36
37
38
fi



bd061de2   Etienne Pallier   bugfix KILL_PYROS...
39
# SEE ALL PROCESSES LAUNCHED
085e388b   Etienne Pallier   added option web ...
40
sleep 3
bd061de2   Etienne Pallier   bugfix KILL_PYROS...
41
42
43
44
./KILL_PYROS_DOCKER_RUN no



a9d06e6f   Etienne Pallier   new PYROS_DOCKER_...
45
46
47
48
49
#cd src/core/pyros_django
#docker exec -it pyros python3 src/core/pyros_django/manage.py runserver 10.121.0.11:8000
#docker exec -it pyros bash -c "cd src/ ; ls -l"
#docker exec -it pyros bash -c "cd src/core/pyros_django/ ; ./manage.py runserver 10.121.0.11:8000"
#docker exec -it pyros python3 manage.py runserver 10.121.0.11:8000 > ../../../../PYROS.log 2>&1 &
e1e75163   Alexis Koralewski   fixing issue with...