Created
May 18, 2020 22:05
-
-
Save lhmachado/14944838d2b861006923e273b69a2aa3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
cd /opt/gremlin-server | |
CONF_FILE=$1 | |
# IP substitution hack borrowed from: | |
# https://github.com/htaox/NEAT/blob/94a004831cf89767e116d955192fc14ac82e5069/docker-scripts/gremlin-server-3.0.0/files/default_cmd#L5 | |
IP=$(ip -o -4 addr list eth0 | perl -n -e 'if (m{inet\s([\d\.]+)\/\d+\s}xms) { print $1 }') | |
sed -i "s|^host:.*|host: $IP|" $CONF_FILE | |
exec /opt/gremlin-server/bin/gremlin-server.sh "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment