Update openvpn-install.sh

Add variables to set expiration of CA certificate and client certificates
This commit is contained in:
Frogger 2022-11-10 10:43:23 +01:00 committed by GitHub
parent 4553dd9c21
commit 33c25977a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,15 @@
# Secure OpenVPN server installer for Debian, Ubuntu, CentOS, Amazon Linux 2, Fedora, Oracle Linux 8, Arch Linux, Rocky Linux and AlmaLinux.
# https://github.com/angristan/openvpn-install
# Certificate expiration
# Default settings
# CA_EXPIRE=3650
# CERT_EXPIRE=825
CA_EXPIRE=7300
CERT_EXPIRE=7300
function isRoot() {
if [ "$EUID" -ne 0 ]; then
return 1
@ -726,6 +735,8 @@ function installOpenVPN() {
echo "$SERVER_NAME" >SERVER_NAME_GENERATED
echo "set_var EASYRSA_REQ_CN $SERVER_CN" >>vars
echo "set_var EASYRSA_CA_EXPIRE $CA_EXPIRE" >>vars
echo "set_var EASYRSA_CERT_EXPIRE $CERT_EXPIRE" >>vars
# Create the PKI, set up the CA, the DH params and the server certificate
./easyrsa init-pki