Skip to content
Snippets Groups Projects
Commit f8e1e63e authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

colored output if jq is found

parent 4ff183c6
Branches
No related tags found
No related merge requests found
......@@ -7,11 +7,15 @@
# requires
# - curl
#
# optional:
# - jq
#
# ----------------------------------------------------------------------
# DOC: https://www.infoblox.com/wp-content/uploads/infoblox-deployment-infoblox-rest-api.pdf
# ----------------------------------------------------------------------
# 2021-01-20 v0.0 <axel.hahn@iml.unibe.ch>
# 2022-01-14 v1.0 <axel.hahn@iml.unibe.ch> 1st public version
# 2022-03-03 v1.1 <axel.hahn@iml.unibe.ch> colored output if jq is found
# ======================================================================
......@@ -36,9 +40,9 @@ fi
relUrl="$1"
# ----- make curl request
echo "; === DNS API"
echo "; method $method"
echo "; rel url ${relUrl}"
echo "; ----------------------------------------------------------------------"
echo "; === DNS API :: $method ${relUrl}"
curl -u $myauth -X $method "${mybaseurl}${relUrl}" 2>/dev/null \
| ( if which jq >/dev/null 2>&1; then jq; else cat; echo ; fi )
curl -u $myauth -X $method "${mybaseurl}${relUrl}" 2>/dev/null
# ----------------------------------------------------------------------
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment