The following will do both domain.com and www.domain.com
#!/bin/bash
if [ "$1" == "" ]; then
echo -e "Must have a domain. e.g. $0 example.com"
exit
fi
#letsencrypt - uncomment the following lines to use letsencrypt instead
#/root/.acme.sh/acme.sh --issue -d $1 -d www.$1 --cert-file /etc/letsencrypt/live/$1/cert.pem --key-file /etc/letsencrypt/live/$1/privkey.pem --fullchain-file /etc/letsencrypt/live/$1/fullchain.pem -w /usr/local/lsws/Example/html -k ec-256 --force --server letsencrypt --debug
#zerossl - uncomment the following lines to use zerossl instead
/root/.acme.sh/acme.sh --set-default-ca --server zerossl
/root/.acme.sh/acme.sh --register-account -m [email protected]
/root/.acme.sh/acme.sh --issue -d $1 -d www.$1 --cert-file /etc/letsencrypt/live/$1/cert.pem --key-file /etc/letsencrypt/live/$1/privkey.pem --fullchain-file /etc/letsencrypt/live/$1/fullchain.pem -w /usr/local/lsws/Example/html -k ec-256 --server zerossl --debug
service lsws restart