Skip to content

Instantly share code, notes, and snippets.

@taesiri
Created June 17, 2023 02:36
Show Gist options
  • Save taesiri/280e714f9d7b7dfb2081e10734161c03 to your computer and use it in GitHub Desktop.
Save taesiri/280e714f9d7b7dfb2081e10734161c03 to your computer and use it in GitHub Desktop.
GetSSL
#!/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