mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-03-14 06:33:17 +01:00
修复禁用用户后重新添加同名用户提示用户已存在的问题
This commit is contained in:
parent
34e2249b22
commit
249ded3db6
@ -1074,7 +1074,7 @@ function newClient() {
|
|||||||
read -rp "Select an option [1-2]: " -e -i 1 PASS
|
read -rp "Select an option [1-2]: " -e -i 1 PASS
|
||||||
done
|
done
|
||||||
|
|
||||||
CLIENTEXISTS=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep -c -E "/CN=$CLIENT\$")
|
CLIENTEXISTS=$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep -E "^V" | grep -c -E "/CN=$CLIENT\$")
|
||||||
if [[ $CLIENTEXISTS == '1' ]]; then
|
if [[ $CLIENTEXISTS == '1' ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "The specified client CN was already found in easy-rsa, please choose another name."
|
echo "The specified client CN was already found in easy-rsa, please choose another name."
|
||||||
@ -1183,7 +1183,6 @@ function revokeClient() {
|
|||||||
rm -f "/root/$CLIENT.ovpn"
|
rm -f "/root/$CLIENT.ovpn"
|
||||||
sed -i "/^$CLIENT,.*/d" /etc/openvpn/ipp.txt
|
sed -i "/^$CLIENT,.*/d" /etc/openvpn/ipp.txt
|
||||||
cp /etc/openvpn/easy-rsa/pki/index.txt{,.bk}
|
cp /etc/openvpn/easy-rsa/pki/index.txt{,.bk}
|
||||||
sed -i "/CN=$CLIENT/d" /etc/openvpn/easy-rsa/pki/index.txt
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Certificate for client $CLIENT revoked."
|
echo "Certificate for client $CLIENT revoked."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user