forked from SUNET/docker-pyff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyffd.sh
35 lines (26 loc) · 732 Bytes
/
pyffd.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
#!/bin/bash
if [ -z "${DATADIR}" ]; then
export DATADIR="/tmp/pyff"
fi
mkdir -p ${DATADIR} && cd ${DATADIR}
if [ -z "${LOGLEVEL}" ]; then
export LOGLEVEL="INFO"
fi
if [ -z "${PIPELINE}" ]; then
export PIPELINE="mdx.fd"
fi
if [ -z "${PORT}" ]; then
export PORT="8080"
fi
if [ ! -f "${PIPELINE}" ]; then
cp /mdx.fd "${PIPELINE}"
openssl genrsa 4096 > default.key
openssl req -x509 -sha1 -new -subj "/CN=Default Metadata Signer" -key default.key -out default.crt
fi
mkdir -p /var/run
CMD="pyffd -f --frequency=${UPDATE_FREQUENCY:-300} --loglevel=${LOGLEVEL} -H 0.0.0.0 -P ${PORT} -p /var/run/pyffd.pid --dir=${DATADIR} -C ${EXTRA_ARGS} ${PIPELINE}"
if [ $# -gt 0 ]; then
exec $*
else
exec ${CMD}
fi