Create ovpn_genclientcert

This commit is contained in:
lawtancool 2019-06-22 21:38:15 -07:00 committed by GitHub
parent af3b10e731
commit 3351f38155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

31
bin/ovpn_genclientcert Normal file
View File

@ -0,0 +1,31 @@
#!/bin/bash
#
# Generate a client certificate with EasyRSA
#
if [ "$DEBUG" == "1" ]; then
set -x
fi
CLIENTNAME=$1
PASSWORD=$2
set -e
source "$OPENVPN/ovpn_env.sh"
# Download EasyRSA because Ubuntu doesn't have it as a CLI command
wget https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.6/EasyRSA-unix-v3.0.6.tgz
tar xvf EasyRSA-unix-v3.0.6.tgz
export EASYRSA="EasyRSA-v3.0.6/"
export EASYRSA_SSL_CONF="EasyRSA-v3.0.6/openssl-easyrsa.cnf"
#cp -r EasyRSA-v3.0.6/x509-types/ x509-types/
EasyRSA-v3.0.6/easyrsa build-client-full $CLIENTNAME $PASSWORD
# Remove EasyRSA files when we're done
rm -r EasyRSA-v3.0.6/
rm EasyRSA-unix-v3.0.6.tgz
rm -r x509-types/