-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-entrypoint
38 lines (27 loc) · 1021 Bytes
/
docker-entrypoint
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
#!/bin/sh
LOCAL_IP=$(hostname -i |grep -E -oh '((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])'|head -n 1)
if [ -z "$IED_NAME" ]; then
export IED_NAME="IED"
fi
if [ -z "$MMS_PORT" ]; then
export MMS_PORT=102
fi
if [ -z "$IEC_61850_EDITION" ]; then
export IEC_61850_EDITION=1
fi
if [ -z "$MAX_MMS_CONNECTIONS" ]; then
export MAX_MMS_CONNECTIONS=10
fi
if [ -z "$MAX_DATA_POINTS" ]; then
export MAX_DATA_POINTS=10000
fi
cd /opt
echo "Compiling IED model..."
java -jar tools/model-generator/genmodel.jar ../model.cid -out src/static_model
echo "Compiling simulation..."
cc -pthread -I./include -I/usr/include/libxml2/ -L./lib -L/usr/lib -DIEC_61850_EDITION=$IEC_61850_EDITION -DMAX_MMS_CONNECTIONS=$MAX_MMS_CONNECTIONS -DMAX_DATA_POINTS=$MAX_DATA_POINTS -o 61850-sim ./src/61850-sim.c ./src/static_model.c -liec61850 -lxml2 -lm
echo "Preparing simulation..."
chmod +x /opt/61850-sim
#file /opt/61850-sim
echo "Running simulation..."
exec /opt/61850-sim