1 | #!/bin/sh
|
2 | set -e
|
3 |
|
4 | cp /opt/shinobi/conf.sample.json /opt/shinobi/conf.json
|
5 | cp /opt/shinobi/super.sample.json /opt/shinobi/super.json
|
6 | cp /opt/shinobi/plugins/motion/conf.sample.json /opt/shinobi/plugins/motion/conf.json
|
7 |
|
8 | ADMIN_PASSWORD_MD5=$(echo -n "${ADMIN_PASSWORD}" | md5sum | sed -e 's/ -$//')
|
9 |
|
10 |
|
11 | sed -i -e 's/"user": "majesticflame"/"user": "'"${MYSQL_USER}"'"/g' \
|
12 | -e 's/"password": ""/"password": "'"${MYSQL_PASSWORD}"'"/g' \
|
13 | -e 's/"host": "127.0.0.1"/"host": "'"${MYSQL_HOST}"'"/g' \
|
14 | -e 's/"database": "ccio"/"database": "'"${MYSQL_DATABASE}"'"/g' \
|
15 | "/opt/shinobi/conf.json"
|
16 |
|
17 | sed -i -e "s/21232f297a57a5a743894a0e4a801fc3/${ADMIN_PASSWORD_MD5}/" "/opt/shinobi/super.json"
|
18 |
|
19 |
|
20 | exec "$@"
|