From bb50a26da06c5cb22c11b7b1c657afcfed20aac5 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 5 May 2016 13:13:22 +0100 Subject: [PATCH] rsdns-did use standard function --- lib/func.sh | 7 +++++-- rsdns-did.sh | 6 +----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/func.sh b/lib/func.sh index 946b36f..5dd6468 100644 --- a/lib/func.sh +++ b/lib/func.sh @@ -168,8 +168,11 @@ function get_domain() { function delete_record() { - get_recordid - + if [ -z $RECORDID ] + then + get_recordid + fi + RC=`curl -k -s -X DELETE -D - -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID|tr -s '[:cntrl:]' "\n"` if [[ $QUIET -eq 0 ]]; then diff --git a/rsdns-did.sh b/rsdns-did.sh index 9ad5135..a2cd2db 100755 --- a/rsdns-did.sh +++ b/rsdns-did.sh @@ -89,11 +89,7 @@ fi # get the domain ID :) check_domain - RC=`curl -k -s -X DELETE -D - -H X-Auth-Token:\ $TOKEN -H Content-Type:\ application/json -H Accept:\ application/json $DNSSVR/$USERID/domains/$DOMAINID/records/$RECORDID|tr -s '[:cntrl:]' "\n"` - - if [[ $QUIET -eq 0 ]]; then - echo $RC - fi +delete_record #done exit 0