Commit d12a4fdd authored by Andy Mayhew's avatar Andy Mayhew

Fixed for renewal directory possibly having a iterated suffix.

parent 90e10224
......@@ -5,8 +5,11 @@
## Utilize GitLab API to update pages certificates.
## Can be run as a CertBot manual-cleanup-hook or manually.
## firt domain listed in your ini
domain="[domain]"
## certDir is the location where CertBot wrote the "live" certificates
certDir="[someplace/live/1st-domain]"
certDir="[someplace/live/]"
## ProjectID and API token for the GitLab
glProjectId="[pages Project ID]"
......@@ -15,6 +18,10 @@ glToken="[GitLab API Token]"
## Pages/Domain API URI for the project. Shouldn't need edit.
glAPI="https://gitlab.com/api/v4/projects/${glProjectId}/pages/domains"
## Find the correct live location.
certDir=`ls -1tr ${liveDir} | grep ${domain} | tail -1`
certDir="${liveDir}${certDir}"
## Cycle through domains for a GitLab project and update their certificates.
for i in `curl -s --header "PRIVATE-TOKEN: ${glToken}" ${glAPI} | jq ".[].domain" | sed 's/"//g'`; do
echo "Updating certificate for: $i"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment