Improve hide_read_pass function

This commit is contained in:
Richard Bonhomme 2018-09-29 13:57:05 +01:00 committed by GitHub
parent 8356b3231d
commit abbae14592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -446,17 +446,9 @@ Your newly created PKI dir is: $EASYRSA_PKI
hide_read_pass()
{
test_file="$EASYRSA/bin/sh.exe"
if [ -f "$test_file" ]
then
set +o echo
read -r "$@"
set -o echo
else
stty -echo
read -r "$@"
stty echo
fi
(set +o echo 2>/dev/null) && set +o echo || stty -echo
read -r "$@"
(set -o echo 2>/dev/null) && set -o echo || stty echo
} # => hide_read_pass()
# build-ca backend: