Only generate dhparams if needed

This commit is contained in:
Bob Mottram 2017-09-25 15:33:00 +01:00
parent 334dbce583
commit 190e37043d
1 changed files with 3 additions and 1 deletions

View File

@ -238,7 +238,9 @@ function install_vpn {
sed -i "s|export KEY_EMAIL.*|export KEY_EMAIL=\"$MY_EMAIL_ADDRESS\"|g" /etc/openvpn/easy-rsa/vars
sed -i "s|export KEY_OU=.*|export KEY_OU=\"MoonUnit\"|g" /etc/openvpn/easy-rsa/vars
sed -i "s|export KEY_NAME.*|export KEY_NAME=\"$OPENVPN_SERVER_NAME\"|g" /etc/openvpn/easy-rsa/vars
if [ ! -f /etc/openvpn/dh2048.pem ]; then
openssl dhparam -out /etc/openvpn/dh2048.pem 2048
fi
cd /etc/openvpn/easy-rsa
. ./vars
./clean-all