Improve client revocation

- Apply upstream change Nyr/openvpn-install commit e574074.
- Remove leftover files after client revocation
- Cleanup
This commit is contained in:
hwdsl2
2025-03-24 21:44:35 -05:00
parent 4a1eb578cb
commit ecaef4943f

View File

@@ -600,7 +600,7 @@ select_protocol() {
select_port() {
if [ "$auto" = 0 ]; then
echo
echo "Which port should OpenVPN listen to?"
echo "Which port should OpenVPN listen on?"
read -rp "Port [1194]: " port
until [[ -z "$port" || "$port" =~ ^[0-9]+$ && "$port" -le 65535 ]]; do
echo "$port: invalid port."
@@ -1289,6 +1289,8 @@ revoke_client_ovpn() {
./easyrsa --batch --days=3650 gen-crl >/dev/null 2>&1
)
rm -f /etc/openvpn/server/crl.pem
rm -f /etc/openvpn/server/easy-rsa/pki/reqs/"$client".req
rm -f /etc/openvpn/server/easy-rsa/pki/private/"$client".key
cp /etc/openvpn/server/easy-rsa/pki/crl.pem /etc/openvpn/server/crl.pem
# CRL is read with each client connection, when OpenVPN is dropped to nobody
chown nobody:"$group_name" /etc/openvpn/server/crl.pem