Created
December 7, 2016 11:25
-
-
Save caius/2bc7f7581c4d3c54b8a010cc4a915946 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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