Merge "Allow only aphanum chars in user-entered passwords"
This commit is contained in:
commit
79b68e388a
9
stack.sh
9
stack.sh
@ -247,12 +247,17 @@ function read_password {
|
||||
echo '################################################################################'
|
||||
echo $msg
|
||||
echo '################################################################################'
|
||||
echo "This value will be written to your localrc file so you don't have to enter it again."
|
||||
echo "It is probably best to avoid spaces and weird characters."
|
||||
echo "This value will be written to your localrc file so you don't have to enter it "
|
||||
echo "again. Use only alphanumeric characters."
|
||||
echo "If you leave this blank, a random default value will be used."
|
||||
pw=" "
|
||||
while true; do
|
||||
echo "Enter a password now:"
|
||||
read -e $var
|
||||
pw=${!var}
|
||||
[[ "$pw" = "`echo $pw | tr -cd [:alnum:]`" ]] && break
|
||||
echo "Invalid chars in password. Try again:"
|
||||
done
|
||||
if [ ! $pw ]; then
|
||||
pw=`openssl rand -hex 10`
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user