diff options
author | Adam T. Carpenter <atc@53hor.net> | 2023-08-27 08:50:06 -0400 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2023-08-27 08:50:06 -0400 |
commit | ea32298b5db6b5f720ad6f053cb3e4b7eca2853a (patch) | |
tree | 3fb41ea14bdaa1be08986055eea7030199c7cdc1 | |
parent | 4220c8b2c4a9aff34c1ffedaf90d092ce5329da7 (diff) | |
download | scripts-ea32298b5db6b5f720ad6f053cb3e4b7eca2853a.tar.xz scripts-ea32298b5db6b5f720ad6f053cb3e4b7eca2853a.zip |
feat: add porkbun api downloader for tls certs
-rwxr-xr-x | porkbun-ssl.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/porkbun-ssl.sh b/porkbun-ssl.sh new file mode 100755 index 0000000..571e491 --- /dev/null +++ b/porkbun-ssl.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +#apikey=SECRET +#secretapikey=SECRET +uri=https://porkbun.com/api/json/v3/ssl/retrieve/ + +get_cert() { + domain=$1 + curl "$uri/$domain" --silent --data "{ \"apikey\": \"$apikey\", \"secretapikey\": \"$secretapikey\" }" +} + +extract_keys() { + jq --raw-output .publickey,.privatekey +} + +for domain in 53hor.net theglassyladies.com +do + get_cert $domain | extract_keys > $domain.pem +done |