You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
686 B
22 lines
686 B
#!/bin/bash
|
|
|
|
CLIENTNAME=test1
|
|
U=$CLIENTNAME
|
|
|
|
vpn_data=$PWD/openvpn-services/
|
|
docker=registry.vlabs.uniwa.gr:5080/myownvpn
|
|
|
|
rm -f $vpn_data/pki/reqs/$CLIENTNAME.req
|
|
rm -f $vpn_data/pki/private/$CLIENTNAME.key
|
|
rm -f $vpn_data/pki/issued/$CLIENTNAME.crt
|
|
rm -f $vpn_data/server/ccd/$CLIENTNAME
|
|
rm -f $vpn_data/ccd/$CLIENTNAME
|
|
pem=$(sudo grep "CN=$U$" $vpn_data/pki/index.txt | cut -f4)
|
|
|
|
rm -f $vpn_data/pki/certs_by_serial/$pem.pem
|
|
sed -i "/CN=$U$/d" $vpn_data/pki/index.txt
|
|
echo $pem
|
|
docker run -v $vpn_data:/etc/openvpn --log-driver=none --rm -it $docker ovpn_revokeclient $CLIENTNAME remove
|
|
|
|
rm -f $vpn_data_user_config/$CLIENTNAME.ovpn
|
|
rm -f $vpn_data_user_config1/$CLIENTNAME.ovpn
|
|
|