Create ovpn_genclientcert
This commit is contained in:
parent
af3b10e731
commit
3351f38155
31
bin/ovpn_genclientcert
Normal file
31
bin/ovpn_genclientcert
Normal 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/
|
Loading…
Reference in New Issue
Block a user