Skip to content

Instantly share code, notes, and snippets.

@ebeigarts
Last active March 27, 2017 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebeigarts/864bcddee4b1290d2b1a2dfbb1653892 to your computer and use it in GitHub Desktop.
Save ebeigarts/864bcddee4b1290d2b1a2dfbb1653892 to your computer and use it in GitHub Desktop.
dokku-reip.sh
for APP in `dokku apps | grep -v '=====> My Apps'`; do
ID=$(cat /home/dokku/$APP/CONTAINER.web.1)
IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ID)
if [ ! -z $IP ]; then
echo " ---> $APP: $IP"
echo $IP > /home/dokku/$APP/IP.web.1
dokku nginx:build-config $APP
fi
done
for APP in `dokku ls | grep stopped | awk '{ print $1 }' | uniq`; do
echo $APP
dokku ps:restart $APP
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment