Created
January 30, 2025 20:56
-
-
Save rambotech/0c942d9b0b8e24c6653c10a844a1b376 to your computer and use it in GitHub Desktop.
Script for launching certbot renew, but opening and closing port 80 only for the duration of the refresh.
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/bash | |
echo =============== | |
echo Open port 80 for verification ... | |
echo =============== | |
you cufw allow 80/tcp && ufw reload | |
echo | |
echo ============== | |
echo Certififcate refresh / renew | |
echo ============== | |
# --nginx only with NGINX installed | |
certbot renew --nginx | |
echo | |
echo ============= | |
echo Close port 80 | |
echo ============= | |
ufw deny 80/tcp && ufw reload | |
echo | |
echo Completed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 6 has a rogue "you c" prefix.. remove it. Sorry bout that.