docker-odoo/9.0/entrypoint.sh

34 lines
742 B
Bash
Raw Normal View History

2015-10-08 05:21:13 -04:00
#!/bin/bash
set -e
# set odoo database host, port, user and password
: ${PGHOST:=$DB_PORT_5432_TCP_ADDR}
: ${PGPORT:=$DB_PORT_5432_TCP_PORT}
: ${PGUSER:=${DB_ENV_POSTGRES_USER:='postgres'}}
: ${PGPASSWORD:=$DB_ENV_POSTGRES_PASSWORD}
export PGHOST PGPORT PGUSER PGPASSWORD
2016-04-10 12:30:42 -04:00
if [[ ! -f /var/lib/odoo/etc/openerp-server.conf ]]; then
mkdir -p /var/lib/odoo/etc
mv /etc/odoo/openerp-server.conf /var/lib/odoo/etc/openerp-server.conf
else
rm -f /etc/odoo/openerp-server.conf
fi
ln -s /var/lib/odoo/etc/openerp-server.conf /etc/odoo/openerp-server.conf
chown -R odoo /var/lib/odoo
2015-10-08 05:21:13 -04:00
case "$1" in
--)
shift
2016-04-10 12:30:42 -04:00
exec gosu odoo openerp-server "$@"
2015-10-08 05:21:13 -04:00
;;
-*)
2016-04-10 12:30:42 -04:00
exec gosu odoo openerp-server "$@"
2015-10-08 05:21:13 -04:00
;;
*)
2016-04-10 12:30:42 -04:00
exec gosu odoo "$@"
2015-10-08 05:21:13 -04:00
esac
exit 1