1
0
mirror of https://github.com/Nyr/openvpn-install.git synced 2024-11-23 21:46:08 +03:00

Added option for client certificate revocation

This commit is contained in:
Nyr 2013-05-14 17:41:53 +02:00
parent 32aad09930
commit c0adc8c75b

View File

@ -43,10 +43,11 @@ if [ -e /etc/openvpn/server.conf ]; then
echo "What do you want to do?" echo "What do you want to do?"
echo "" echo ""
echo "1) Add a cert for a new user" echo "1) Add a cert for a new user"
echo "2) Remove OpenVPN" echo "2) Revoke existing user cert"
echo "3) Exit" echo "3) Remove OpenVPN"
echo "4) Exit"
echo "" echo ""
read -p "Select an option [1-3]:" option read -p "Select an option [1-4]:" option
case $option in case $option in
1) 1)
echo "" echo ""
@ -75,7 +76,17 @@ if [ -e /etc/openvpn/server.conf ]; then
echo "Client $CLIENT added, certs available at ~/ovpn-$CLIENT.tar.gz" echo "Client $CLIENT added, certs available at ~/ovpn-$CLIENT.tar.gz"
exit exit
;; ;;
2) 2)
echo ""
echo "Tell me the existing client name"
read -p "Client name: " -e -i client CLIENT
. /etc/openvpn/easy-rsa/2.0/vars
. /etc/openvpn/easy-rsa/2.0/revoke-full $CLIENT
echo ""
echo "Certificate for client $CLIENT revoked"
exit
;;
3)
apt-get remove --purge -y openvpn openvpn-blacklist apt-get remove --purge -y openvpn openvpn-blacklist
rm -r /etc/openvpn rm -r /etc/openvpn
rm -r /usr/share/doc/openvpn rm -r /usr/share/doc/openvpn
@ -85,7 +96,7 @@ if [ -e /etc/openvpn/server.conf ]; then
echo "OpenVPN removed!" echo "OpenVPN removed!"
exit exit
;; ;;
3) exit;; 4) exit;;
esac esac
done done
else else