Merge c5ace8a03d37cbcafd83b017679ad1c8ae8fd59c into 7e32f6ae8373fe66e657cb693518c45768d0ea6e

This commit is contained in:
Konstantin Sky 2025-03-19 23:14:30 +03:00 committed by GitHub
commit 0019211b8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1092,8 +1092,10 @@ verb 3" >>/etc/openvpn/client-template.txt
fi
# Generate the custom client.ovpn
newClient
echo "If you want to add more clients, you simply need to run this script another time!"
if [[ -n "${CLIENT}" ]]; then
newClient
echo "If you want to add more clients, you simply need to run this script another time!"
fi
}
function newClient() {
@ -1119,7 +1121,7 @@ function newClient() {
if [[ $CLIENTEXISTS == '1' ]]; then
echo ""
echo "The specified client CN was already found in easy-rsa, please choose another name."
exit
exit 1
else
cd /etc/openvpn/easy-rsa/ || return
case $PASS in
@ -1205,7 +1207,15 @@ function revokeClient() {
echo ""
echo "Select the existing client certificate you want to revoke"
tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | nl -s ') '
pki_clientnumbers="$(tail -n +2 /etc/openvpn/easy-rsa/pki/index.txt | grep "^V" | cut -d '=' -f 2 | nl -s ') ')"
echo "${pki_clientnumbers}"
if [[ -n "${CLIENT}" ]]; then
# Get PKI client number
CLIENTNUMBER=$(echo "${pki_clientnumbers}" | grep "${CLIENT}" | cut -d')' -f1 | xargs)
fi
until [[ $CLIENTNUMBER -ge 1 && $CLIENTNUMBER -le $NUMBEROFCLIENTS ]]; do
if [[ $CLIENTNUMBER == '1' ]]; then
read -rp "Select one client [1]: " CLIENTNUMBER