parent
0a4aa69e9f
commit
4bf07e6ca0
1 changed files with 11 additions and 9 deletions
|
|
@ -1036,16 +1036,18 @@ function revokeClient () {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
until [[ "$CLIENT" =~ ^[a-zA-Z0-9_]+$ ]]; do
|
||||||
echo "Select the existing client certificate you want to revoke"
|
echo ""
|
||||||
tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | nl -s ') '
|
echo "Select the existing client certificate you want to revoke"
|
||||||
if [[ "$NUMBEROFCLIENTS" = '1' ]]; then
|
tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | nl -s ') '
|
||||||
read -rp "Select one client [1]: " CLIENTNUMBER
|
if [[ "$NUMBEROFCLIENTS" = '1' ]]; then
|
||||||
else
|
read -rp "Select one client [1]: " CLIENTNUMBER
|
||||||
read -rp "Select one client [1-$NUMBEROFCLIENTS]: " CLIENTNUMBER
|
else
|
||||||
fi
|
read -rp "Select one client [1-$NUMBEROFCLIENTS]: " CLIENTNUMBER
|
||||||
|
fi
|
||||||
|
|
||||||
CLIENT=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | sed -n "$CLIENTNUMBER"p)
|
CLIENT=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | sed -n "$CLIENTNUMBER"p)
|
||||||
|
done
|
||||||
cd /etc/openvpn/easy-rsa/
|
cd /etc/openvpn/easy-rsa/
|
||||||
./easyrsa --batch revoke "$CLIENT"
|
./easyrsa --batch revoke "$CLIENT"
|
||||||
EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
|
EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue