From 671a69947219a745cb3882b33d4b60a312b5cb60 Mon Sep 17 00:00:00 2001 From: neilpang Date: Mon, 9 Jan 2017 22:01:48 +0800 Subject: [PATCH] minor, fix shellcheck warning --- dnsapi/dns_dp.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dnsapi/dns_dp.sh b/dnsapi/dns_dp.sh index 06833b4b..3691be06 100755 --- a/dnsapi/dns_dp.sh +++ b/dnsapi/dns_dp.sh @@ -199,7 +199,7 @@ _get_root() { #Usage: method URI data _rest() { - m=$1 + m="$1" ep="$2" data="$3" _debug "$ep" @@ -207,11 +207,11 @@ _rest() { _debug url "$url" - if [ "$data" ]; then + if [ "$m" = "GET" ]; then + response="$(_get "$url" | tr -d '\r')" + else _debug2 data "$data" response="$(_post "$data" "$url" | tr -d '\r')" - else - response="$(_get "$url" | tr -d '\r')" fi if [ "$?" != "0" ]; then