[FIX] Odoo 11.0-13.0: get database config value

This commit is contained in:
Anang Aji Rahmawan 2019-10-26 01:46:46 +07:00 committed by Christophe Monniez
parent ffe62bdd52
commit 9c3a2dd128
3 changed files with 16 additions and 13 deletions

View File

@ -13,10 +13,11 @@ DB_ARGS=()
function check_config() {
param="$1"
value="$2"
if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then
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}")
fi;
}
check_config "db_host" "$HOST"
check_config "db_port" "$PORT"

View File

@ -13,10 +13,11 @@ DB_ARGS=()
function check_config() {
param="$1"
value="$2"
if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then
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}")
fi;
}
check_config "db_host" "$HOST"
check_config "db_port" "$PORT"

View File

@ -13,10 +13,11 @@ DB_ARGS=()
function check_config() {
param="$1"
value="$2"
if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then
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}")
fi;
}
check_config "db_host" "$HOST"
check_config "db_port" "$PORT"