1
0
docker-ttrss/entrypoint.sh

20 lines
522 B
Bash
Raw Normal View History

2016-12-27 12:11:55 +01:00
#!/bin/bash
set -e
# remove trailing / if any.
SELF_URL_PATH=${SELF_URL_PATH/%\//}
# extract the root path from SELF_URL_PATH (i.e http://domain.tld/<root_path>).
ROOT_PATH=${SELF_URL_PATH/#http*\:\/\/*\//}
if [ "${ROOT_PATH}" == "${SELF_URL_PATH}" ]; then
# no root path in SELF_URL_PATH.
mkdir -p /var/tmp
ln -sf "/var/www" "/var/tmp/www"
2016-12-27 12:11:55 +01:00
else
mkdir -p /var/tmp/www
ln -sf "/var/www" "/var/tmp/www/${ROOT_PATH}"
2016-12-27 12:11:55 +01:00
fi
php /configure-db.php
exec supervisord -c /etc/supervisor/conf.d/supervisord.conf