Skip to content

Instantly share code, notes, and snippets.

@richardevs
Created November 28, 2019 06:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save richardevs/585deadee542b24fafa85a4096c07ce6 to your computer and use it in GitHub Desktop.
Save richardevs/585deadee542b24fafa85a4096c07ce6 to your computer and use it in GitHub Desktop.
Renew all acme.sh certs and restart nginx
export LE_WORKING_DIR="/root/.acme.sh"
alias acme.sh="/root/.acme.sh/acme.sh"
[ -d /root/acme_logs ] || mkdir /root/acme_logs
for i in $(/root/.acme.sh/acme.sh --list | sed 1d | awk '{print $1}'); do
touch /root/acme_logs/$i.$(date +%Y%m%d)
# If you do not have ecc certificate, remove the "--ecc" option below
/root/.acme.sh/acme.sh --renew -d $i --ecc >> /root/acme_logs/$i.$(date +%Y%m%d)
done
nginx -t && kill -s HUP $(pgrep nginx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment