Merge 259991b24e25e29505899099d62823d6ffe1bda9 into 7e32f6ae8373fe66e657cb693518c45768d0ea6e

This commit is contained in:
Omid Shojaee 2025-03-17 17:28:53 +03:30 committed by GitHub
commit acc844f9fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1105,6 +1105,10 @@ function newClient() {
read -rp "Client name: " -e CLIENT read -rp "Client name: " -e CLIENT
done done
echo ""
echo "How many days should the client be valid for?"
read -rp "Enter the number of days (default is 3650, which is about 10 years): " -e -i 3650 DAYS_VALID
echo "" echo ""
echo "Do you want to protect the configuration file with a password?" echo "Do you want to protect the configuration file with a password?"
echo "(e.g. encrypt the private key with a password)" echo "(e.g. encrypt the private key with a password)"
@ -1124,14 +1128,14 @@ function newClient() {
cd /etc/openvpn/easy-rsa/ || return cd /etc/openvpn/easy-rsa/ || return
case $PASS in case $PASS in
1) 1)
EASYRSA_CERT_EXPIRE=3650 ./easyrsa --batch build-client-full "$CLIENT" nopass EASYRSA_CERT_EXPIRE=$DAYS_VALID ./easyrsa --batch build-client-full "$CLIENT" nopass
;; ;;
2) 2)
echo "⚠️ You will be asked for the client password below ⚠️" echo "⚠️ You will be asked for the client password below ⚠️"
EASYRSA_CERT_EXPIRE=3650 ./easyrsa --batch build-client-full "$CLIENT" EASYRSA_CERT_EXPIRE=$DAYS_VALID ./easyrsa --batch build-client-full "$CLIENT"
;; ;;
esac esac
echo "Client $CLIENT added." echo "Client $CLIENT added and is valid for $DAYS_VALID days."
fi fi
# Home directory of the user, where the client configuration will be written # Home directory of the user, where the client configuration will be written