now using _post in place of curl as requested, and passing shellchecks

This commit is contained in:
Steven M. Miano 2019-02-26 07:03:32 -05:00
parent 6fb38b3e67
commit ac01e4b37b

View File

@ -85,7 +85,7 @@ dns_ultra_rm() {
return 1
fi
count=$(echo "%s\n" "$response" | _egrep_o "\"returnedCount\":[^,]*" | cut -d: -f2 | cut -d'}' -f1)
count=$(echo "$response" | _egrep_o "\"returnedCount\":[^,]*" | cut -d: -f2 | cut -d'}' -f1)
_debug count "${count}"
if [ "${count}" = "" ]; then
_info "Text record is not present, will not delete anything."
@ -157,8 +157,8 @@ _ultra_rest() {
}
_ultra_login() {
AUTH_TOKEN=$(curl -X POST --data \
"grant_type=password&username=${ULTRA_USR}&password=${ULTRA_PWD}" \
"${ULTRA_API}authorization/token" | cut -d, -f3 | cut -d\" -f4)
export _H1=""
export _H2=""
AUTH_TOKEN=$(_post "grant_type=password&username=${ULTRA_USR}&password=${ULTRA_PWD}" "${ULTRA_API}authorization/token" | cut -d, -f3 | cut -d\" -f4)
export AUTH_TOKEN
}