From 0927810bd4c3a5c6b8b1a868876996386fe92382 Mon Sep 17 00:00:00 2001 From: cjwbath <40788773+cjwbath@users.noreply.github.com> Date: Mon, 10 Jan 2022 16:15:18 +0000 Subject: [PATCH] Fix stripping of extraneous fields since totalEntries now appears first in the JSON --- lib/func.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/func.sh b/lib/func.sh index 678f12a..1c83347 100644 --- a/lib/func.sh +++ b/lib/func.sh @@ -46,7 +46,7 @@ function get_domains() { fi # Legacy variable/response for backward compatability - DOMAINS=`echo $jDOMAINS |tr -s '[:cntrl:]' "\n" |sed -e 's/{"domains":\[{//' -e 's/}\]}//' -e 's/},{/;/g' -e 's/"name"://g' -e 's/"id"://g' -e 's/"accountId"://g' -e 's/"updated"://g' -e 's/"created"://g' -e 's/"totalEntries"://g'` + DOMAINS=`echo $jDOMAINS |tr -s '[:cntrl:]' "\n" |sed -e 's/"domains":\[{//' -e 's/}\]}//' -e 's/},{/;/g' -e 's/"name"://g' -e 's/"id"://g' -e 's/"accountId"://g' -e 's/"updated"://g' -e 's/"created"://g' -e 's/{"totalEntries":[0-9]*,//g'` } function get_records() { @@ -79,7 +79,7 @@ function get_records() { fi #echo $jRECORDS | jq . - RECORDS=`echo $jRECORDS |tr -s '[:cntrl:]' "\n"| sed -e 's/{"records":\[{//' -e 's/}\]}//' -e 's/},{/;/g' -e 's/"name"://g' -e 's/"id"://g' -e 's/"type"://g' -e 's/"data"://g' -e 's/"updated"://g' -e 's/"created"://g' -e 's/"totalEntries"://g'` + RECORDS=`echo $jRECORDS |tr -s '[:cntrl:]' "\n"| sed -e 's/"records":\[{//' -e 's/}\]}//' -e 's/},{/;/g' -e 's/"name"://g' -e 's/"id"://g' -e 's/"type"://g' -e 's/"data"://g' -e 's/"updated"://g' -e 's/"created"://g' -e 's/{"totalEntries":[0-9]*,//g'` } function check_domain() {