Browse Source

Added proper id lookup

Bjarne Saltbaek 4 years ago
parent
commit
17b1875151
1 changed files with 1 additions and 2 deletions
  1. 1 2
      dnsapi/dns_cpanel.sh

+ 1 - 2
dnsapi/dns_cpanel.sh

@@ -144,8 +144,7 @@ _findentry() {
   _debug "In _findentry"
   #returns id of dns entry, if it exists
   _myget "json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&domain=$_domain"
-  #_jqquery=".cpanelresult.data[] | select(.name == \"$fulldomain.\")| {Line} | .Line"
-  _id=""
+  _id=$(echo "$_result" | sed  "s/.*\(line.*$fulldomain\).*/\1/" | cut -d ':' -f 2 | cut -d ',' -f 1
   _debug "_result is: $_result"
   _debug "fulldomain. is $fulldomain."
   _debug "_id is: $_id"