From 7d1c5fca0b211168bc9e5f9cfe916f92c22f9fed Mon Sep 17 00:00:00 2001 From: neilpang Date: Wed, 7 Dec 2016 13:52:31 +0800 Subject: [PATCH] fix for solaris --- dnsapi/dns_dp.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dnsapi/dns_dp.sh b/dnsapi/dns_dp.sh index 155979af..81edc225 100755 --- a/dnsapi/dns_dp.sh +++ b/dnsapi/dns_dp.sh @@ -102,7 +102,7 @@ existing_records() { fi if _contains "$response" "Action completed successful"; then - count=$(printf "%s" "$response" | grep 'TXT' | wc -l) + count=$(printf "%s" "$response" | grep 'TXT' | wc -l | tr -d ' ') record_id=$(printf "%s" "$response" | grep '^' | tail -1 | cut -d '>' -f 2 | cut -d '<' -f 1) return 0 else @@ -208,9 +208,9 @@ _rest() { if [ "$data" ]; then _debug2 data "$data" - response="$(_post "$data" "$url")" + response="$(_post "$data" "$url" | tr -d '\r')" else - response="$(_get "$url")" + response="$(_get "$url" | tr -d '\r')" fi if [ "$?" != "0" ]; then