diff options
Diffstat (limited to 'porkbun-ssl.sh')
-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 |