Created
August 22, 2018 20:20
-
-
Save sanderploegsma/c749a315271eb68ba4d5d52e46f3d44e 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/sh | |
CLUSTER_CONFIG="/data/nodes.conf" | |
if [ -f ${CLUSTER_CONFIG} ]; then | |
if [ -z "${POD_IP}" ]; then | |
echo "Unable to determine Pod IP address!" | |
exit 1 | |
fi | |
echo "Updating my IP to ${POD_IP} in ${CLUSTER_CONFIG}" | |
sed -i.bak -e '/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${POD_IP}/' ${CLUSTER_CONFIG} | |
fi | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment