UX: accept direct password input at GUI replace prompt
This commit is contained in:
@@ -177,7 +177,9 @@ collect_inputs() {
|
||||
log_warn "Пароль GUI не задан. Сгенерирован пароль (8 символов): ${GUI_PASSWORD}"
|
||||
|
||||
if (( ! NON_INTERACTIVE )); then
|
||||
if confirm "Хотите заменить сгенерированный пароль GUI?"; then
|
||||
local replace_or_password=""
|
||||
read -r -p "Хотите заменить сгенерированный пароль GUI? [y/N] (или введите пароль сразу): " replace_or_password
|
||||
if [[ "$replace_or_password" =~ ^([yY][eE][sS]|[yY])$ ]]; then
|
||||
local custom_gui_password=""
|
||||
ask_secret "Введите новый пароль GUI (${GUI_USER})" custom_gui_password
|
||||
if [[ -n "$custom_gui_password" ]]; then
|
||||
@@ -186,6 +188,9 @@ collect_inputs() {
|
||||
else
|
||||
log_warn "Пустой пароль не принят. Остается сгенерированный пароль."
|
||||
fi
|
||||
elif [[ -n "$replace_or_password" && ! "$replace_or_password" =~ ^([nN][oO]?|[nN])$ ]]; then
|
||||
GUI_PASSWORD="$replace_or_password"
|
||||
GUI_PASSWORD_GENERATED=0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user