Last active
December 14, 2017 23:37
-
-
Save metakirby5/a27ff54aa63f2c042a550614a0984cce to your computer and use it in GitHub Desktop.
Automatically update letsencrypt certificate for all nginx domains
This file contains hidden or 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
#!/usr/bin/env bash | |
# Updates nginx letsencrypt domains by server_name. | |
/opt/letsencrypt/letsencrypt-auto \ | |
certonly -a webroot --webroot-path=/var/www/ssl \ | |
$(grep -hro '^\s*server_name\s\+[a-zA-Z0-9.-]\+' /etc/nginx/ | | |
sort | uniq | awk '{print "-d", $2}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Most recent version at https://github.com/metakirby5/scripts/blob/master/letsencrypt