summaryrefslogtreecommitdiff
path: root/porkbun-ssl.sh
blob: 571e491a373b1223c12ebb805ce361d78fcc3590 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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