Created
May 24, 2024 08:20
-
-
Save gijigae/5db9f4aa1250ed5d627f138603cda6c3 to your computer and use it in GitHub Desktop.
Install Certbot and issue an SSL certificate for a given domain
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
| #!/bin/sh | |
| # Check if a domain is provided | |
| if [ -z "$1" ]; then | |
| echo "Usage: sudo sh certbot.sh <domain>" | |
| exit 1 | |
| fi | |
| DOMAIN=$1 | |
| # Install certbot and the nginx plugin | |
| apt install -y certbot python3-certbot-nginx | |
| # Run certbot with the provided domain | |
| certbot --nginx -d $DOMAIN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment