-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·86 lines (72 loc) · 1.63 KB
/
entrypoint.sh
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
#!/bin/sh
LOGDIR=/opt/spt/logs
Defaults()
{
if [ -z "$HTTP_PORT" ]
then
HTTP_PORT=6020
echo "PORT not set. Will default to $HTTP_PORT"
fi
if [ -z "$TCP_PORT" ]
then
TCP_PORT=2020
echo "PORT not set. Will default to $TCP_PORT"
fi
if [ -z "$NOTIFY_PORT" ]
then
NOTIFY_PORT=2120
echo "PORT not set. Will default to $NOTIFY_PORT"
fi
if [ -z "$THREADS" ]
then
THREADS=`nproc --all`
echo "THREADS not set. Will default to $THREADS"
fi
if [ -z "$LOG_LEVEL" ]
then
LOG_LEVEL="info"
echo "LOG_LEVEL not set. Will default to $LOG_LEVEL"
fi
}
Args()
{
args=''
if [ -n "$ENCRYPTION_SECRET" ]
then
args=" --encryption-secret $ENCRYPTION_SECRET"
echo "AES encryption secret specified."
fi
if [ -n "$ENABLE_SSL" ]
then
echo "ENABLE_SSL specified. Enabling SSL for services"
args="$args --with-ssl"
fi
if [ -n "$ENABLE_CACHE" ]
then
echo "ENABLE_CACHE set. Will enable temporary cache of keys"
args="$args --enable-cache"
fi
if [ -n "$PEERS" ]
then
echo "PEERS set. Will enable notification to and from peers"
args="$args --peers $PEERS"
fi
}
Service()
{
if [ -n "$DEBUG" ]
then
echo "DEBUG specified, shell into container and start using gdb.sh"
tail -f /dev/null
fi
echo "Starting config-db service"
if [ -n "$CONFIG_FILE" ]
then
/opt/spt/bin/configdb --config-file $CONFIG_FILE
else
/opt/spt/bin/configdb --console --log-dir ${LOGDIR}/ --log-level $LOG_LEVEL \
--http-port $HTTP_PORT --tcp-port $TCP_PORT --notify-port $NOTIFY_PORT \
--threads $THREADS $args
fi
}
Defaults && Args && Service