-
-
Save rwmotivation/c31523368c2c22ce055a8dad2b98c5b4 to your computer and use it in GitHub Desktop.
Script to renew Let's Encrypt certificate and then replace certificate on OpenVPN server
This file contains 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 | |
( | |
DOMAIN="vpn.example.com" | |
set -eu | |
certbot renew -q | |
/usr/local/openvpn_as/scripts/sacli stop | |
/usr/local/openvpn_as/scripts/confdba -mk cs.ca_bundle -v "`cat /etc/letsencrypt/live/$DOMAIN/fullchain.pem`" | |
/usr/local/openvpn_as/scripts/confdba -mk cs.priv_key -v "`cat /etc/letsencrypt/live/$DOMAIN/privkey.pem`" > /dev/null | |
/usr/local/openvpn_as/scripts/confdba -mk cs.cert -v "`cat /etc/letsencrypt/live/$DOMAIN/cert.pem`" | |
/usr/local/openvpn_as/scripts/sacli start | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment