fix wget support in dns api

This commit is contained in:
neil
2016-05-07 23:33:42 +08:00
parent 94dc5f330c
commit a4270efac9
4 changed files with 49 additions and 34 deletions

View File

@ -71,7 +71,6 @@ existing_records() {
if printf "$response" | grep "Action completed successful" >/dev/null ; then
count=$(printf "$response" | grep '<type>TXT</type>' | wc -l)
record_id=$(printf "$response" | grep '^<id>' | tail -1 | cut -d '>' -f 2 | cut -d '<' -f 1)
return 0
else
@ -175,17 +174,17 @@ _get_root() {
_rest() {
m=$1
ep="$2"
data="$3"
_debug $ep
url="$REST_API/$ep"
_debug url "$url"
if [ "$3" ] ; then
data="$3"
if [ "$data" ] ; then
_debug2 data "$data"
response="$(curl --silent -X $m "$url" -d $data)"
response="$(_post $data "$url")"
else
response="$(curl --silent -X $m "$url" )"
response="$(_get "$url")"
fi
if [ "$?" != "0" ] ; then