Merge 82976fd520
into 9534c8c2fd
This commit is contained in:
commit
1ed62c8d11
@ -12,17 +12,23 @@ fi
|
||||
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
|
||||
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
|
||||
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
|
||||
: ${PSQL_TIMEOUT:=${DB_INIT_TIMEOUT:=30}}
|
||||
|
||||
DB_ARGS=()
|
||||
function check_config() {
|
||||
param="$1"
|
||||
value="$2"
|
||||
if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then
|
||||
value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g')
|
||||
fi;
|
||||
if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC"; then
|
||||
value=$(
|
||||
grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" \
|
||||
| cut -d " " -f3 \
|
||||
| sed 's/["\n\r]//g'
|
||||
)
|
||||
fi
|
||||
DB_ARGS+=("--${param}")
|
||||
DB_ARGS+=("${value}")
|
||||
}
|
||||
|
||||
check_config "db_host" "$HOST"
|
||||
check_config "db_port" "$PORT"
|
||||
check_config "db_user" "$USER"
|
||||
@ -34,12 +40,12 @@ case "$1" in
|
||||
if [[ "$1" == "scaffold" ]] ; then
|
||||
exec odoo "$@"
|
||||
else
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=$PSQL_TIMEOUT
|
||||
exec odoo "$@" "${DB_ARGS[@]}"
|
||||
fi
|
||||
;;
|
||||
-*)
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=$PSQL_TIMEOUT
|
||||
exec odoo "$@" "${DB_ARGS[@]}"
|
||||
;;
|
||||
*)
|
||||
|
@ -12,17 +12,23 @@ fi
|
||||
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
|
||||
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
|
||||
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
|
||||
: ${PSQL_TIMEOUT:=${DB_INIT_TIMEOUT:=30}}
|
||||
|
||||
DB_ARGS=()
|
||||
function check_config() {
|
||||
param="$1"
|
||||
value="$2"
|
||||
if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then
|
||||
value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g')
|
||||
fi;
|
||||
if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC"; then
|
||||
value=$(
|
||||
grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" \
|
||||
| cut -d " " -f3 \
|
||||
| sed 's/["\n\r]//g'
|
||||
)
|
||||
fi
|
||||
DB_ARGS+=("--${param}")
|
||||
DB_ARGS+=("${value}")
|
||||
}
|
||||
|
||||
check_config "db_host" "$HOST"
|
||||
check_config "db_port" "$PORT"
|
||||
check_config "db_user" "$USER"
|
||||
@ -34,12 +40,12 @@ case "$1" in
|
||||
if [[ "$1" == "scaffold" ]] ; then
|
||||
exec odoo "$@"
|
||||
else
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=$PSQL_TIMEOUT
|
||||
exec odoo "$@" "${DB_ARGS[@]}"
|
||||
fi
|
||||
;;
|
||||
-*)
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=$PSQL_TIMEOUT
|
||||
exec odoo "$@" "${DB_ARGS[@]}"
|
||||
;;
|
||||
*)
|
||||
|
@ -12,17 +12,23 @@ fi
|
||||
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
|
||||
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
|
||||
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
|
||||
: ${PSQL_TIMEOUT:=${DB_INIT_TIMEOUT:=30}}
|
||||
|
||||
DB_ARGS=()
|
||||
function check_config() {
|
||||
param="$1"
|
||||
value="$2"
|
||||
if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then
|
||||
value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g')
|
||||
fi;
|
||||
if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC"; then
|
||||
value=$(
|
||||
grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" \
|
||||
| cut -d " " -f3 \
|
||||
| sed 's/["\n\r]//g'
|
||||
)
|
||||
fi
|
||||
DB_ARGS+=("--${param}")
|
||||
DB_ARGS+=("${value}")
|
||||
}
|
||||
|
||||
check_config "db_host" "$HOST"
|
||||
check_config "db_port" "$PORT"
|
||||
check_config "db_user" "$USER"
|
||||
@ -34,12 +40,12 @@ case "$1" in
|
||||
if [[ "$1" == "scaffold" ]] ; then
|
||||
exec odoo "$@"
|
||||
else
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=$PSQL_TIMEOUT
|
||||
exec odoo "$@" "${DB_ARGS[@]}"
|
||||
fi
|
||||
;;
|
||||
-*)
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=30
|
||||
wait-for-psql.py ${DB_ARGS[@]} --timeout=$PSQL_TIMEOUT
|
||||
exec odoo "$@" "${DB_ARGS[@]}"
|
||||
;;
|
||||
*)
|
||||
|
Loading…
Reference in New Issue
Block a user