Update url params in shell_config.

This commit is contained in:
Nikolai Kochetov 2019-10-11 15:08:11 +03:00
parent 48bfcab428
commit 2ecf7abf6c

View File

@ -38,9 +38,25 @@ export CLICKHOUSE_PORT_HTTP=${CLICKHOUSE_PORT_HTTP:="8123"}
export CLICKHOUSE_PORT_HTTPS=${CLICKHOUSE_PORT_HTTPS:=`${CLICKHOUSE_EXTRACT_CONFIG} --try --key=https_port 2>/dev/null`} 2>/dev/null
export CLICKHOUSE_PORT_HTTPS=${CLICKHOUSE_PORT_HTTPS:="8443"}
export CLICKHOUSE_PORT_HTTP_PROTO=${CLICKHOUSE_PORT_HTTP_PROTO:="http"}
# Add database to url params
if [-z "$CLICKHOUSE_URL_PARAMS"]
then
export CLICKHOUSE_URL_PARAMS=${CLICKHOUSE_URL_PARAMS:="${CLICKHOUSE_URL_PARAMS}&database=${CLICKHOUSE_DATABASE}"}
else
export CLICKHOUSE_URL_PARAMS=${CLICKHOUSE_URL_PARAMS:="database=${CLICKHOUSE_DATABASE}"}
fi
export CLICKHOUSE_URL=${CLICKHOUSE_URL:="${CLICKHOUSE_PORT_HTTP_PROTO}://${CLICKHOUSE_HOST}:${CLICKHOUSE_PORT_HTTP}/"}
export CLICKHOUSE_URL_HTTPS=${CLICKHOUSE_URL_HTTPS:="https://${CLICKHOUSE_HOST}:${CLICKHOUSE_PORT_HTTPS}/"}
export CLICKHOUSE_URL_PARAMS=${CLICKHOUSE_URL_PARAMS:="${CLICKHOUSE_URL}?database=${CLICKHOUSE_DATABASE}"}
# Add url params to url
if [-z "$CLICKHOUSE_URL_PARAMS"]
then
export CLICKHOUSE_URL=${CLICKHOUSE_URL:="${CLICKHOUSE_URL}?${$CLICKHOUSE_URL_PARAMS}"}
export CLICKHOUSE_URL_HTTPS=${CLICKHOUSE_URL_HTTPS:="${CLICKHOUSE_URL_HTTPS}?${$CLICKHOUSE_URL_PARAMS}"}
fi
export CLICKHOUSE_PORT_INTERSERVER=${CLICKHOUSE_PORT_INTERSERVER:=`${CLICKHOUSE_EXTRACT_CONFIG} --try --key=interserver_http_port 2>/dev/null`} 2>/dev/null
export CLICKHOUSE_PORT_INTERSERVER=${CLICKHOUSE_PORT_INTERSERVER:="9009"}
export CLICKHOUSE_URL_INTERSERVER=${CLICKHOUSE_URL_INTERSERVER:="${CLICKHOUSE_PORT_HTTP_PROTO}://${CLICKHOUSE_HOST}:${CLICKHOUSE_PORT_INTERSERVER}/"}