mirror of
https://github.com/hwdsl2/openvpn-install.git
synced 2026-01-11 02:46:16 +00:00
Improve client revocation
- Apply upstream change Nyr/openvpn-install commit e574074. - Remove leftover files after client revocation - Cleanup
This commit is contained in:
@@ -600,7 +600,7 @@ select_protocol() {
|
|||||||
select_port() {
|
select_port() {
|
||||||
if [ "$auto" = 0 ]; then
|
if [ "$auto" = 0 ]; then
|
||||||
echo
|
echo
|
||||||
echo "Which port should OpenVPN listen to?"
|
echo "Which port should OpenVPN listen on?"
|
||||||
read -rp "Port [1194]: " port
|
read -rp "Port [1194]: " port
|
||||||
until [[ -z "$port" || "$port" =~ ^[0-9]+$ && "$port" -le 65535 ]]; do
|
until [[ -z "$port" || "$port" =~ ^[0-9]+$ && "$port" -le 65535 ]]; do
|
||||||
echo "$port: invalid port."
|
echo "$port: invalid port."
|
||||||
@@ -1289,6 +1289,8 @@ revoke_client_ovpn() {
|
|||||||
./easyrsa --batch --days=3650 gen-crl >/dev/null 2>&1
|
./easyrsa --batch --days=3650 gen-crl >/dev/null 2>&1
|
||||||
)
|
)
|
||||||
rm -f /etc/openvpn/server/crl.pem
|
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
|
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
|
# CRL is read with each client connection, when OpenVPN is dropped to nobody
|
||||||
chown nobody:"$group_name" /etc/openvpn/server/crl.pem
|
chown nobody:"$group_name" /etc/openvpn/server/crl.pem
|
||||||
|
|||||||
Reference in New Issue
Block a user