Merge a3041161e47e784a1b94618a617c5247019940db into e2d4990ae194e37fd5162168a8aac5e2d89e0e8d

This commit is contained in:
Podesta 2025-02-05 18:03:50 +07:00 committed by GitHub
commit 0084a510f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -644,8 +644,12 @@ function installQuestions() {
done done
fi fi
echo "" echo ""
# Ask the user if they would like to add a new client after installation.
until [[ $NEW_CLIENT =~ (y|n) ]]; do
read -rp "Would you like to add a new client after installation? [y/n]: " -e -i y NEW_CLIENT
done
echo ""
echo "Okay, that was all I needed. We are ready to setup your OpenVPN server now." echo "Okay, that was all I needed. We are ready to setup your OpenVPN server now."
echo "You will be able to generate a client at the end of the installation."
APPROVE_INSTALL=${APPROVE_INSTALL:-n} APPROVE_INSTALL=${APPROVE_INSTALL:-n}
if [[ $APPROVE_INSTALL =~ n ]]; then if [[ $APPROVE_INSTALL =~ n ]]; then
read -n1 -r -p "Press any key to continue..." read -n1 -r -p "Press any key to continue..."
@ -666,6 +670,7 @@ function installOpenVPN() {
CLIENT=${CLIENT:-client} CLIENT=${CLIENT:-client}
PASS=${PASS:-1} PASS=${PASS:-1}
CONTINUE=${CONTINUE:-y} CONTINUE=${CONTINUE:-y}
NEW_CLIENT=${NEW_CLIENT:-y}
if [[ -z $ENDPOINT ]]; then if [[ -z $ENDPOINT ]]; then
ENDPOINT=$(resolvePublicIP) ENDPOINT=$(resolvePublicIP)
@ -1087,8 +1092,12 @@ verb 3" >>/etc/openvpn/client-template.txt
fi fi
# Generate the custom client.ovpn # Generate the custom client.ovpn
newClient if [[ $NEW_CLIENT == "n" ]]; then
echo "If you want to add more clients, you simply need to run this script another time!" echo "No clients added. To add clients, simply run the script again."
else
newClient
echo "If you want to add more clients, you simply need to run this script another time!"
fi
} }
function newClient() { function newClient() {