Skip to content

Commit

Permalink
Simplify run-trino script
Browse files Browse the repository at this point in the history
  • Loading branch information
nineinchnick committed May 20, 2022
1 parent acf3c9c commit ac71185
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions core/docker/bin/run-trino
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

set -xeuo pipefail

set +e
grep -s -q 'node.id' /etc/trino/node.properties
NODE_ID_EXISTS=$?
set -e

NODE_ID=""
if [[ ${NODE_ID_EXISTS} != 0 ]] ; then
NODE_ID="-Dnode.id=${HOSTNAME}"
launcher_opts=(--etc-dir /etc/trino)
if ! grep -s -q 'node.id' /etc/trino/node.properties; then
launcher_opts+=("-Dnode.id=${HOSTNAME}")
fi

exec /usr/lib/trino/bin/launcher run --etc-dir /etc/trino ${NODE_ID} "$@"
exec /usr/lib/trino/bin/launcher run "${launcher_opts[@]}" "$@"

0 comments on commit ac71185

Please sign in to comment.