File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
22
3- response=$( curl -X GET " https://api.cloudflare.com/client/v4/zones/$ZONE_ID /ssl/certificate_packs" \
3+ domain=" $1 "
4+
5+ response=$( curl -X GET " https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID /ssl/certificate_packs" \
46 -H " Content-Type: application/json" \
5- -H " Authorization: Bearer $POLYKEY_DOCS_CLOUDFLARE_CLEANUP_TOKEN " )
7+ -H " Authorization: Bearer $CLOUDFLARE_API_TOKEN " )
68
7- cert_ids=$( echo " $response " | jq -r --arg domain " $DOMAIN " ' .result[] | select(.hosts[] | contains($domain)) | .id' )
9+ cert_ids=$( echo " $response " | jq -r --arg domain " $domain " ' .result[] | select(.hosts[] | contains($domain)) | .id' )
810
911echo " $cert_ids " | while read -r cert_id; do
10- curl -X DELETE --url " https://api.cloudflare.com/client/v4/zones/$ZONE_ID /ssl/certificate_packs/$cert_id " \
12+ curl -X DELETE --url " https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID /ssl/certificate_packs/$cert_id " \
1113 -H " Content-Type: application/json" \
12- -H " Authorization: Bearer $POLYKEY_DOCS_CLOUDFLARE_CLEANUP_TOKEN "
14+ -H " Authorization: Bearer $CLOUDFLARE_API_TOKEN "
1315done
You can’t perform that action at this time.
0 commit comments