This repository has been archived on 2020-08-21. You can view files and clone it, but cannot push or open issues or pull requests.
pa4home/entrypoint.sh
2015-01-30 18:43:53 +01:00

24 lines
575 B
Bash

#!/bin/sh
BASEDIR=/srv/www/pa4home
# Creating directory and set permissions
mkdir -p ${BASEDIR}/onyx/log
chown -R www-data:www-data ${BASEDIR}/onyx/log
# Update database profile
cat <<EOF > ${BASEDIR}/onyx/db/docker.profile.php &&
<?php
if(!defined('ONYX')) exit;
\$___profile['db'] = '$DB_ENV_MYSQL_DATABASE';
\$___profile['host'] = '$DB_PORT_3306_TCP_ADDR';
\$___profile['user'] = '$DB_ENV_MYSQL_USER';
\$___profile['pass'] = '$DB_ENV_MYSQL_PASSWORD';
EOF
sed -i 's/"profile">sample</"profile">docker</' ${BASEDIR}/onyx/config/root.xml
# Continue execution
exec "$@"