From 190e37043d8e51cbf3073d9869ae65fcd24f821f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 25 Sep 2017 15:33:00 +0100 Subject: [PATCH] Only generate dhparams if needed --- src/freedombone-app-vpn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/freedombone-app-vpn b/src/freedombone-app-vpn index 98bd9874..95a4eecd 100755 --- a/src/freedombone-app-vpn +++ b/src/freedombone-app-vpn @@ -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 - openssl dhparam -out /etc/openvpn/dh2048.pem 2048 + if [ ! -f /etc/openvpn/dh2048.pem ]; then + openssl dhparam -out /etc/openvpn/dh2048.pem 2048 + fi cd /etc/openvpn/easy-rsa . ./vars ./clean-all