Update ovpn_revokeclient

This commit is contained in:
Lawrence Tan 2022-06-07 16:40:54 -07:00 committed by GitHub
parent cd12942dc0
commit 6a86b23ed8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,11 +30,24 @@ if [ ! -f "$EASYRSA_PKI/private/${cn}.key" ]; then
fi fi
revoke_client_certificate(){ revoke_client_certificate(){
easyrsa revoke "$1" # 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 revoke "$1"
echo "Generating the Certificate Revocation List :" echo "Generating the Certificate Revocation List :"
easyrsa gen-crl EasyRSA-v3.0.6/easyrsa gen-crl
cp -f "$EASYRSA_PKI/crl.pem" "$OPENVPN/crl.pem" cp -f "$EASYRSA_PKI/crl.pem" "$OPENVPN/crl.pem"
chmod 644 "$OPENVPN/crl.pem" chmod 644 "$OPENVPN/crl.pem"
# Remove EasyRSA files when we're done
rm -r EasyRSA-v3.0.6/
rm EasyRSA-unix-v3.0.6.tgz
rm -r x509-types/
} }
remove_files(){ remove_files(){