mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-15 06:42:28 +00:00
0ea4ea7d0c
* also note in titan-gremlin that 1.x of ES is needed * provide docker compose snippet Part of #68
64 lines
1.3 KiB
Bash
Executable file
64 lines
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
args=
|
|
|
|
if [ $(ls /conf|wc -l) = 0 ]; then
|
|
cp -r $TITAN_HOME/conf/* /conf
|
|
fi
|
|
|
|
rm -f /tmp/titan.properties
|
|
|
|
if [ -n "$CASS_PORT_9160_TCP_ADDR" ]; then
|
|
|
|
shortcut=/tmp/titan.properties
|
|
cat >> /tmp/titan.properties <<END
|
|
storage.backend=cassandra
|
|
storage.hostname=$CASS_PORT_9160_TCP_ADDR
|
|
END
|
|
|
|
elif [ -n "$CASS_ADDR" ]; then
|
|
|
|
shortcut=/tmp/titan.properties
|
|
cat >> /tmp/titan.properties <<END
|
|
storage.backend=cassandra
|
|
storage.hostname=$CASS_ADDR
|
|
END
|
|
|
|
fi
|
|
|
|
|
|
esAddr=${ES_ENV_PUBLISH_AS:-${ES_PORT_9300_TCP_ADDR}}
|
|
|
|
if [ -n "$ES_CLUSTER" -o -n "$esAddr" ]; then
|
|
shortcut=/tmp/titan.properties
|
|
cat >> /tmp/titan.properties <<END
|
|
index.search.backend=elasticsearch
|
|
index.search.elasticsearch.client-only=true
|
|
END
|
|
|
|
if [ -n "$ES_CLUSTER" ]; then
|
|
cat >> /tmp/titan.properties <<END
|
|
index.search.elasticsearch.ext.cluster.name=$ES_CLUSTER
|
|
END
|
|
fi
|
|
if [ -n "$esAddr" ]; then
|
|
# strip off the port spec, if present
|
|
esAddr=$(echo $esAddr | cut -d: -f1)
|
|
cat >> /tmp/titan.properties <<END
|
|
index.search.hostname=$esAddr
|
|
END
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -n "$shortcut" ]; then
|
|
cat > /tmp/init.groovy <<END
|
|
g = TitanFactory.open('$shortcut')
|
|
println 'The graph \'g\' was opened using $shortcut'
|
|
END
|
|
args="$args /tmp/init.groovy"
|
|
fi
|
|
|
|
# Allow a little extra time for Cassandra to be ready
|
|
sleep 1
|
|
exec $TITAN_HOME/bin/gremlin.sh $args
|