forked from DevoInc/devo-relay
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-start
More file actions
executable file
·37 lines (28 loc) · 1.12 KB
/
docker-start
File metadata and controls
executable file
·37 lines (28 loc) · 1.12 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
#!/bin/bash
set -e
if [ $SELFSIGNED == "1" ]; then
export PYTHONHTTPSVERIFY=0
echo "export PYTHONHTTPSVERIFY=0" > /opt/devo/relay-data/selfsigned
else
rm -f /opt/devo/relay-data/selfsigned
fi
envtpl --keep-template /etc/logtrust/relay/logtrust.conf.tpl
envtpl --keep-template /etc/logtrust/scoja/version1/local.py.tpl
echo "" > /opt/devo/relay-data/scoja.pid
chmod 600 /etc/logtrust/relay/logtrust.conf /etc/logtrust/scoja/version1/local.py
### Recovery connection if it exists previously
if [ -f "/opt/devo/relay-data/pass.temp" ]; then
newpass=`cat /opt/devo/relay-data/pass.temp |cut -d"=" -f2|sed 's/\//'"\\\\\\\\\/"'/g'`
sed -i -e 's/keypass = \".*\"/keypass = \"'"${newpass}"'\"/' /etc/logtrust/scoja/current/local.py
fi
/opt/logtrust/relay/UpdateRelay.py > /var/log/lt-relay.log 2>&1
runPath=/opt/devo/run
LockFile=scoja
FILE="${runPath}/${LockFile}.lock"
if [ ! -f "$FILE" ]; then
touch $FILE
/opt/logtrust/scoja/scoja.sh -r 5s -G /etc/logtrust/scoja/version1/all-me.conf -j /etc/logtrust/scoja/version1/all-var.conf > /var/log/scoja.log 2>&1 &
echo $! > /opt/devo/relay-data/scoja.pid
fi
/usr/sbin/cron -f
### END