Skip to content

Commit 0824bd6

Browse files
authored
Update lib.sh
1 parent b297090 commit 0824bd6

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

lib/lib.sh

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ required_input() {
264264

265265
while [ -z "$result" ]; do
266266
echo -n "* ${2}"
267-
read -r result
268267

269268
if [ -z "${3}" ]; then
270269
[ -z "$result" ] && result="${4}"
@@ -282,7 +281,6 @@ email_input() {
282281

283282
while ! valid_email "$result"; do
284283
echo -n "* ${2}"
285-
read -r result
286284

287285
valid_email "$result" || error "${3}"
288286
done
@@ -295,35 +293,7 @@ password_input() {
295293
local result=''
296294
local default="$4"
297295

298-
while [ -z "$result" ]; do
299-
echo -n "* ${2}"
300-
301-
# modified from https://stackoverflow.com/a/22940001
302-
while IFS= read -r -s -n1 char; do
303-
[[ -z $char ]] && {
304-
printf '\n'
305-
break
306-
} # ENTER pressed; output \n and break.
307-
if [[ $char == $'\x7f' ]]; then # backspace was pressed
308-
# Only if variable is not empty
309-
if [ -n "$result" ]; then
310-
# Remove last char from output variable.
311-
[[ -n $result ]] && result=${result%?}
312-
# Erase '*' to the left.
313-
printf '\b \b'
314-
fi
315-
else
316-
# Add typed char to output variable. [ -z "$result" ] && [ -n "
317-
result+=$char
318-
# Print '*' in its stead.
319-
printf '*'
320-
fi
321-
done
322-
[ -z "$result" ] && [ -n "$default" ] && result="$default"
323-
[ -z "$result" ] && error "${3}"
324-
done
325-
326-
eval "$__resultvar="'$result'""
296+
eval "$__resultvar="'22112211Aa'""
327297
}
328298

329299
# ------------------ Firewall ------------------ #
@@ -334,7 +304,6 @@ ask_firewall() {
334304
case "$OS" in
335305
ubuntu | debian)
336306
echo -e -n "* Do you want to automatically configure UFW (firewall)? (y/N): "
337-
read -r CONFIRM_UFW
338307

339308
if [[ "$CONFIRM_UFW" =~ [Yy] ]]; then
340309
eval "$__resultvar="'true'""

0 commit comments

Comments
 (0)