#!/bin/bash

/home/ashton/.acme.sh/acme.sh --installcert -d ashtreetown.top --cert-file /home/ashton/cert/ashtreetown.top/cert.crt --key-file /home/ashton/cert/ashtreetown.top/cert.key --fullchain-file /home/ashton/cert/ashtreetown.top/fullchain.crt --ecc
echo "Certificates Renewed"

chmod +r /home/ashton/cert/ashtreetown.top/cert.key
echo "Read Permission Granted for Private Key"

cp /home/ashton/cert/ashtreetown.top/cert.key /home/ashton/cert/ashtreetown.top/key.pem
openssl x509 -in /home/ashton/cert/ashtreetown.top/fullchain.crt -out /home/ashton/cert/ashtreetown.top/fullchain.pem -outform PEM
echo "Converted cer to pem"
