# Find/isolate the root zone to work with in createRecord() and deleteRecord()
# Find/isolate the root zone to work with in createRecord() and deleteRecord()
rootZone=""
rootZone=""
if["$checkMultiZones"="true"];then
if["$checkMultiZones"="true"];then
rootZone=$(for zone in$(echo"$result" | tr-d'\n'' ');do
#rootZone=$(for x in $(printf "%s" "${result3}" | tr ',' '\n' | sed -n 's/.*"name":"\(.*\)",.*/\1/p'); do if [ "$(echo "$domain" | grep "$x")" != "" ]; then echo "$x"; fi; done)
if["$(echo"$domain" | grep"$zone")"!=""];then
rootZone=$(for x in$(printf"%s\n""${result3}" | tr',''\n' | grep name | cut-d'"'-f4);do if["$(echo"$domain" | grep"$x")"!=""];then echo"$x";fi;done)
_debug2 _get_root "- trying to figure out if $zone is in $domain"
if["$rootZone"!=""];then
echo"$zone"
_debug2 _rootZone "- root zone for $domain is $rootZone"
break
else
fi
_err "Could not find root zone for $domain, is it correctly typed?"