a3d207f2d4
Do not assume that Odoo will handle correctly the PG* environment variables, because it won't. We also rename the PG* variables in order to avoid confusion since we do not export them anymore.
26 lines
563 B
Bash
Executable File
26 lines
563 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# 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)
|
|
|
|
case "$1" in
|
|
--)
|
|
shift
|
|
exec odoo "${DB_ARGS[@]}" "$@"
|
|
;;
|
|
-*)
|
|
exec odoo "${DB_ARGS[@]}" "$@"
|
|
;;
|
|
*)
|
|
exec "$@"
|
|
esac
|
|
|
|
exit 1
|