Skip to content

Instantly share code, notes, and snippets.

@jverweijL
Created May 3, 2018 06:54
Show Gist options
  • Save jverweijL/1f335996ff758de355dcafb82231e85a to your computer and use it in GitHub Desktop.
Save jverweijL/1f335996ff758de355dcafb82231e85a to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo certbot renew --dry-run
read -e -p "Install new certificate? " -i "yes" answer
if [ "$answer" = "yes" ]; then
sudo certbot renew; # Fetches new certificate
fi
read -e -p "Restart nginx? " -i "yes" answer
if [ "$answer" = "yes" ]; then
sudo systemctl restart nginx; # Restart nginx
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment