瀏覽代碼

First jq rework - 10. redo

Bjarne Saltbaek 4 年之前
父節點
當前提交
f3cfef4021
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dnsapi/dns_cpanel.sh

+ 1 - 1
dnsapi/dns_cpanel.sh

@@ -118,7 +118,7 @@ _myget() {
 
 _get_root() {
   _myget 'json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzones'
-  _domains=$(echo "$_result" | cut -d ':' -f9 | sed 's/"//g' | sed 's/{//g')
+  _domains=$(echo "$_result" | sed 's/.*\(zones.*\[\).*/\1/' | cut -d':' -f2 | sed 's/"//g' | sed 's/{//g')
   _debug "_result is: $_result"
   _debug "_domains is: $_domains"
   if [ -z "$_domains" ]; then