Created
June 17, 2023 02:36
-
-
Save taesiri/280e714f9d7b7dfb2081e10734161c03 to your computer and use it in GitHub Desktop.
GetSSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function generate_cert() { | |
if [ $# -ne 2 ]; then | |
echo "Usage: generate_cert <email> <domain>" | |
return 1 | |
fi | |
local email=$1 | |
local domain=$2 | |
curl https://get.acme.sh | sh | |
~/.acme.sh/acme.sh --set-default-ca --server letsencrypt | |
~/.acme.sh/acme.sh --register-account -m "$email" | |
~/.acme.sh/acme.sh --issue -d "$domain" --standalone | |
~/.acme.sh/acme.sh --installcert -d "$domain" --key-file /root/private.key --fullchain-file /root/cert.crt | |
} | |
generate_cert $1 $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment