This commit is contained in:
Tercio Gaudencio Filho 2017-06-05 15:57:01 +00:00 committed by GitHub
commit b677f2d70f

View File

@ -110,6 +110,7 @@ if [[ -e /etc/openvpn/server.conf ]]; then
else
read -p "Select one client [1-$NUMBEROFCLIENTS]: " CLIENTNUMBER
fi
if [[ "$CLIENTNUMBER" =~ ^[0-9]+$ ]] && [[ "$CLIENTNUMBER" -ge 1 ]] && [[ "$CLIENTNUMBER" -le $NUMBEROFCLIENTS ]]; then
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/
./easyrsa --batch revoke $CLIENT
@ -123,6 +124,11 @@ if [[ -e /etc/openvpn/server.conf ]]; then
chown nobody:$GROUPNAME /etc/openvpn/crl.pem
echo ""
echo "Certificate for client $CLIENT revoked"
else
echo ""
echo "You selected an invalid client!"
exit 7
fi
exit
;;
3)