2014-12-10 06:20:15 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-03-08 01:18:12 -05:00
|
|
|
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}}
|
|
|
|
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='postgres'}}}
|
|
|
|
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=$POSTGRES_PASSWORD}}
|
|
|
|
# pass them as arguments to the odoo process
|
|
|
|
DB_ARGS=("--db_user" $USER "--db_password" $PASSWORD "--db_host" $HOST "--db_port" $PORT)
|
2014-12-10 06:20:15 -05:00
|
|
|
|
2015-03-17 12:45:37 -04:00
|
|
|
case "$1" in
|
|
|
|
--)
|
|
|
|
shift
|
2016-10-28 09:15:57 -04:00
|
|
|
exec openerp-server "${DB_ARGS[@]}" "$@"
|
2015-03-17 12:45:37 -04:00
|
|
|
;;
|
|
|
|
-*)
|
2016-10-28 09:15:57 -04:00
|
|
|
exec openerp-server "${DB_ARGS[@]}" "$@"
|
2015-03-17 12:45:37 -04:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exec "$@"
|
|
|
|
esac
|
2015-02-27 08:41:23 -05:00
|
|
|
|
2015-03-17 12:45:37 -04:00
|
|
|
exit 1
|