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.

Revisions

  1. ebeigarts revised this gist Mar 27, 2017. 2 changed files with 14 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions dokku-reip
    Original file line number Diff line number Diff line change
    @@ -1,2 +0,0 @@
    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
    14 changes: 14 additions & 0 deletions dokku-reip.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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
  2. ebeigarts revised this gist Mar 27, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion dokku-reip
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    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 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
  3. ebeigarts created this gist Mar 27, 2017.
    1 change: 1 addition & 0 deletions dokku-reip
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    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