Skip to content

Instantly share code, notes, and snippets.

@ebeigarts
Last active March 27, 2017 12:12
Show Gist options
  • Select an option

  • Save ebeigarts/864bcddee4b1290d2b1a2dfbb1653892 to your computer and use it in GitHub Desktop.

Select an option

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