Skip to content

Instantly share code, notes, and snippets.

@selivan
Created June 11, 2018 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save selivan/af762d34504e27d56829e3602739d592 to your computer and use it in GitHub Desktop.
Save selivan/af762d34504e27d56829e3602739d592 to your computer and use it in GitHub Desktop.
Letsencrypt update certs using webroot
#!/bin/bash
DOMAINS=example.net
WEBROOT=/var/www/html
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
certbot certonly --webroot --webroot-path "$WEBROOT" --register-unsafely-without-email -d "$DOMAINS"
iptables -D INPUT -p tcp --dport 80 -j ACCEPT
apache2ctl graceful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment