Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
Created February 16, 2021 05:42
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 ryanvgates/c8a5ce48b7e1527e6018fae080491691 to your computer and use it in GitHub Desktop.
Save ryanvgates/c8a5ce48b7e1527e6018fae080491691 to your computer and use it in GitHub Desktop.
Fail TeamCity on not resolve host
set -x
set -e
ping -c 4 %host.name%
curl -H "Accept: application/json" -H \
http://%host.name%/GetStatus \
| jq . | tee status.txt
res=$?
if test "$res" != "0"; then
echo "the curl command failed with: $res"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment