Exit, afer easyrsa errors
If easyrsa returns an error on creation or revoke client cert, do not continue the rest of script,
This commit is contained in:
parent
7e7a494f59
commit
9af10ff24b
1 changed files with 3 additions and 3 deletions
|
|
@ -1029,11 +1029,11 @@ function newClient () {
|
|||
cd /etc/openvpn/easy-rsa/ || return
|
||||
case $PASS in
|
||||
1)
|
||||
./easyrsa build-client-full "$CLIENT" nopass
|
||||
./easyrsa build-client-full "$CLIENT" nopass || exit $?
|
||||
;;
|
||||
2)
|
||||
echo "⚠️ You will be asked for the client password below ⚠️"
|
||||
./easyrsa build-client-full "$CLIENT"
|
||||
./easyrsa build-client-full "$CLIENT" || exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
|
|
@ -1109,7 +1109,7 @@ function revokeClient () {
|
|||
|
||||
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
|
||||
./easyrsa --batch revoke "$CLIENT"
|
||||
./easyrsa --batch revoke "$CLIENT" || exit $?
|
||||
EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
|
||||
# Cleanup
|
||||
rm -f "pki/reqs/$CLIENT.req"
|
||||
|
|
|
|||
Loading…
Reference in a new issue