Skip to content

Instantly share code, notes, and snippets.

@ashlux
Last active May 1, 2019 22: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 ashlux/c6bdc65fdb138ed6036aa8ab8f638d28 to your computer and use it in GitHub Desktop.
Save ashlux/c6bdc65fdb138ed6036aa8ab8f638d28 to your computer and use it in GitHub Desktop.
Single line cloud foundry command to rolling restart all CF app instances. Works on OSX with Bash and ZSH. YMMV.
#!/bin/bash
for app in $(cf apps | tail +5 | awk '{ print $1 }') ; do for i in `cf app ${app} | egrep '^#.*$' | awk '{ print $1 }' | sed s/\#//` ; do echo Restarting $app $i && cf restart-app-instance $app $i ; done ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment