#!/bin/bash

export DOMAIN_NAME=super-idol.107421.xyz

export CF_Token="oXJRP5XI8Zhipa_PtYtB_jy6qWL0I9BosrJEYE8p"
export CF_Account_ID="dfaadeb83406ef5ad35da02617af9191"
export CF_Zone_ID="511894a4f1357feb905e974e16241ebb"

acme.sh   --issue   --dns dns_cf -d ${DOMAIN_NAME} --keylength ec-256



acme.sh --install-cert -d ${DOMAIN_NAME} --ecc \
--key-file       /etc/nginx/conf.d/ssl_key/${DOMAIN_NAME}.key.pem  \
--fullchain-file /etc/nginx/conf.d/ssl_key/${DOMAIN_NAME}.cert.pem \
--reloadcmd     "systemctl restart nginx --force"


openssl x509 -noout -fingerprint -sha256 -in /root/.acme.sh/super-idol.107421.xyz_ecc/fullchain.cer

cp /root/.acme.sh/super-idol.107421.xyz_ecc/super-idol.107421.xyz.cer /etc/hysteria/super-idol.107421.xyz.cert
cp /root/.acme.sh/super-idol.107421.xyz_ecc/super-idol.107421.xyz.key /etc/hysteria/super-idol.107421.xyz.key

cp /root/.acme.sh/super-idol.107421.xyz_ecc/fullchain.cer /etc/hysteria/super-idol.107421.xyz.cert

cp /root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/fullchain.cer /etc/trojan-go/xx.s4.cc.hh.107421.xyz.cert
cp /root/.acme.sh/xx.s4.cc.hh.107421.xyz_ecc/xx.s4.cc.hh.107421.xyz.key /etc/trojan-go/xx.s4.cc.hh.107421.xyz.key
