Skip to content

Instantly share code, notes, and snippets.

@caius
Created December 7, 2016 11:25
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 caius/2bc7f7581c4d3c54b8a010cc4a915946 to your computer and use it in GitHub Desktop.
Save caius/2bc7f7581c4d3c54b8a010cc4a915946 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Find puppet cattle running a specific branch via mco puppetd
#
# USAGE: puppetd_branch BRANCH
#
set -e
declare branch="$1"
mco puppetd environment -v | awk -v branch=$branch 'BEGIN { counter = 0 }; $1 == branch { counter = $2 + 1 }; counter > 0 { counter -= 1; print $0 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment