2015-10-08 05:21:13 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2016-10-28 09:15:57 -04:00
|
|
|
# set the postgres database host, port, user and password
|
|
|
|
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
|
|
|
|
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
|
2016-11-03 06:42:54 -04:00
|
|
|
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
|
|
|
|
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
|
2016-10-28 09:15:57 -04:00
|
|
|
# pass them as arguments to the odoo process
|
|
|
|
DB_ARGS=("--db_user" $USER "--db_password" $PASSWORD "--db_host" $HOST "--db_port" $PORT)
|
2015-10-08 05:21:13 -04:00
|
|
|
|
|
|
|
case "$1" in
|
2016-11-03 09:17:25 -04:00
|
|
|
-- | openerp-server)
|
2015-10-08 05:21:13 -04:00
|
|
|
shift
|
2016-10-28 09:15:57 -04:00
|
|
|
exec openerp-server "${DB_ARGS[@]}" "$@"
|
2015-10-08 05:21:13 -04:00
|
|
|
;;
|
|
|
|
-*)
|
2016-10-28 09:15:57 -04:00
|
|
|
exec openerp-server "${DB_ARGS[@]}" "$@"
|
2015-10-08 05:21:13 -04:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exec "$@"
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 1
|