test
This commit is contained in:
parent
11175a9450
commit
f9a7d1cf91
1 changed files with 17 additions and 14 deletions
|
|
@ -1045,23 +1045,26 @@ function newClient () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function revokeClient () {
|
function revokeClient () {
|
||||||
NUMBEROFCLIENTS=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep -c "^V")
|
until [[ "$CLIENT" =~ ^[a-zA-Z0-9_]+$ ]]; do
|
||||||
if [[ "$NUMBEROFCLIENTS" = '0' ]]; then
|
NUMBEROFCLIENTS=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep -c "^V")
|
||||||
|
if [[ "$NUMBEROFCLIENTS" = '0' ]]; then
|
||||||
|
echo ""
|
||||||
|
echo "You have no existing clients!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "You have no existing clients!"
|
echo "Select the existing client certificate you want to revoke"
|
||||||
exit 1
|
tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | nl -s ') '
|
||||||
fi
|
if [[ "$NUMBEROFCLIENTS" = '1' ]]; then
|
||||||
|
read -rp "Select one client [1]: " CLIENTNUMBER
|
||||||
|
else
|
||||||
|
read -rp "Select one client [1-$NUMBEROFCLIENTS]: " CLIENTNUMBER
|
||||||
|
fi
|
||||||
|
|
||||||
echo ""
|
CLIENT=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | sed -n "$CLIENTNUMBER"p)
|
||||||
echo "Select the existing client certificate you want to revoke"
|
done
|
||||||
tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | nl -s ') '
|
|
||||||
if [[ "$NUMBEROFCLIENTS" = '1' ]]; then
|
|
||||||
read -rp "Select one client [1]: " CLIENTNUMBER
|
|
||||||
else
|
|
||||||
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)
|
|
||||||
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