From e1902bc2cd0b529342322f709a5130d92a1e5ef3 Mon Sep 17 00:00:00 2001 From: Kyle Manna Date: Wed, 4 Jun 2014 16:49:13 -0700 Subject: [PATCH] ovpn_genconfig: Add generate config script * Create a generate config script so that the new docker containers can regenerate the OpenVPN configuration without clobbering the PKI setup. --- bin/ovpn_genconfig | 36 ++++++++++++++++++++++++++++++++++++ bin/ovpn_init | 22 +--------------------- 2 files changed, 37 insertions(+), 21 deletions(-) create mode 100755 bin/ovpn_genconfig diff --git a/bin/ovpn_genconfig b/bin/ovpn_genconfig new file mode 100755 index 0000000..4b88747 --- /dev/null +++ b/bin/ovpn_genconfig @@ -0,0 +1,36 @@ +#!/bin/sh + +# +# Generate OpenVPN configs +# + +set -ex + +cn=$1 + +if [ -z "$cn" ]; then + echo "Common name not specified" + exit 1 +fi + +cat > "$OPENVPN/udp1194.conf" < $OPENVPN/servername easyrsa build-server-full $cn nopass -[ -f "$OPENVPN/udp1194.conf" ] || cat > "$OPENVPN/udp1194.conf" <