#!/bin/sh # # Get an OpenVPN client configuration file # set -ex cn=$1 if [ -z "$cn" ]; then echo "Common name not specified" exit 1 fi if [ ! -f "$EASYRSA_PKI/private/$cn.key" ]; then easyrsa build-server-full $cn nopass fi servername=$(cat $OPENVPN/servername) cat < $(cat $EASYRSA_PKI/private/$cn.key) $(cat $EASYRSA_PKI/issued/$cn.crt) $(cat $EASYRSA_PKI/ca.crt) $(cat $EASYRSA_PKI/dh.pem) $(cat $EASYRSA_PKI/ta.key) key-direction 1 remote $servername 1194 udp EOF