Revoke clients only when $CLIENTNUMBER is set

Fix #477
This commit is contained in:
randomshell 2020-03-29 07:06:49 +00:00 committed by GitHub
parent 44105eb060
commit 2384dc1eaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1107,6 +1107,7 @@ function revokeClient () {
read -rp "Select one client [1-$NUMBEROFCLIENTS]: " CLIENTNUMBER read -rp "Select one client [1-$NUMBEROFCLIENTS]: " CLIENTNUMBER
fi fi
if [[ "$CLIENTNUMBER" != "" ]]; then
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)
cd /etc/openvpn/easy-rsa/ || return cd /etc/openvpn/easy-rsa/ || return
./easyrsa --batch revoke "$CLIENT" ./easyrsa --batch revoke "$CLIENT"
@ -1124,6 +1125,7 @@ function revokeClient () {
echo "" echo ""
echo "Certificate for client $CLIENT revoked." echo "Certificate for client $CLIENT revoked."
fi
} }
function removeUnbound () { function removeUnbound () {