Add checks for user input
This commit is contained in:
parent
42d2b7456f
commit
6a65d4a8e0
1 changed files with 6 additions and 2 deletions
|
|
@ -114,7 +114,9 @@ if [[ -e /etc/openvpn/server.conf ]]; then
|
||||||
echo "(e.g. encrypt the private key with a password)"
|
echo "(e.g. encrypt the private key with a password)"
|
||||||
echo " 1) Add a passwordless client"
|
echo " 1) Add a passwordless client"
|
||||||
echo " 2) Use a password for the client"
|
echo " 2) Use a password for the client"
|
||||||
read -p "Select an option [1-2]: " pass
|
until [[ "$pass" =~ ^[1-2]$ ]]; do
|
||||||
|
read -rp "Select an option [1-2]: " -e -i 1 pass
|
||||||
|
done
|
||||||
echo ""
|
echo ""
|
||||||
echo "Tell me a name for the client cert"
|
echo "Tell me a name for the client cert"
|
||||||
echo "Please, use one word only, no special characters"
|
echo "Please, use one word only, no special characters"
|
||||||
|
|
@ -334,7 +336,9 @@ else
|
||||||
echo "(e.g. encrypt the private key with a password)"
|
echo "(e.g. encrypt the private key with a password)"
|
||||||
echo " 1) Add a passwordless client"
|
echo " 1) Add a passwordless client"
|
||||||
echo " 2) Use a password for the client"
|
echo " 2) Use a password for the client"
|
||||||
read -p "Select an option [1-2]: " pass
|
until [[ "$pass" =~ ^[1-2]$ ]]; do
|
||||||
|
read -rp "Select an option [1-2]: " -e -i 1 pass
|
||||||
|
done
|
||||||
echo ""
|
echo ""
|
||||||
echo "Finally, tell me a name for the client certificate and configuration"
|
echo "Finally, tell me a name for the client certificate and configuration"
|
||||||
while [[ $CLIENT = "" ]]; do
|
while [[ $CLIENT = "" ]]; do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue