Update ovpn_revokeclient
This commit is contained in:
parent
cd12942dc0
commit
6a86b23ed8
@ -30,11 +30,24 @@ if [ ! -f "$EASYRSA_PKI/private/${cn}.key" ]; then
|
||||
fi
|
||||
|
||||
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 :"
|
||||
easyrsa gen-crl
|
||||
EasyRSA-v3.0.6/easyrsa gen-crl
|
||||
cp -f "$EASYRSA_PKI/crl.pem" "$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(){
|
||||
|
Loading…
Reference in New Issue
Block a user