Add ACA address as option 3rd commandline parameter. Handle case where no reports are available or selected for download.

This commit is contained in:
chubtub
2021-03-16 10:16:17 -04:00
parent 7064c00c0b
commit 175d2238d2
2 changed files with 15 additions and 4 deletions

View File

@ -3,8 +3,15 @@
#User input parameters:
#$1 filter start date 'yyyy-mm-dd'
#$2 filter end date 'yyyy-mm-dd'
#$3 ACA address, default is localhost if not given
endpoint="https://localhost:8443/HIRS_AttestationCAPortal/portal/validation-reports"
if [ -z "$3" ]
then
endpoint="https://localhost:8443/HIRS_AttestationCAPortal/portal/validation-reports"
else
endpoint="https://$3:8443/HIRS_AttestationCAPortal/portal/validation-reports"
fi
echo "$endpoint"
content=$(curl --insecure $endpoint/list)
rawTimes=$(jq -r '.data | map(.createTime | tostring) | join(",")' <<< "$content")
createTimes=""