This commit is contained in:
tavo 2024-05-16 14:46:57 -06:00
parent aa06a9d9ec
commit 0f80b05bbf

View file

@ -68,11 +68,13 @@ if [ "$MENU" = "zenity" ] ; then
zenity --title "$TITLE" --text "$PROMPT_END_SUCCESS" --info
elif [ "$MENU" = "term" ] ; then
term_prompt info "$PROMPT_WELCOME" && read -r NULL
term_prompt info "$PROMPT_WELCOME"
read -r NULL
! command -v curl >/dev/null 2>&1 && term_prompt error "$PROMPT_ERR_DEPS curl" && exit 1
# Serial number is required for download
term_prompt entry "$PROMPT_SERIAL" && read -r SERIAL
term_prompt entry "$PROMPT_SERIAL"
read -r SERIAL
[ -z "$SERIAL" ] && term_prompt error "$PROMPT_ERR_SERIAL" && exit 1
echo_debug "Generar tempkey y obtener URL de descarga" # DEBUG
@ -91,7 +93,8 @@ elif [ "$MENU" = "term" ] ; then
curl "$DOWNLOAD_URL" -o "$SAVE_FILE" --progress-bar
echo_debug "Consultar sudo pass" # DEBUG
term_prompt entry "$PROMPT_SUDO_PASSWORD" && IFS= read -r SUDO_PASSWORD
term_prompt entry "$PROMPT_SUDO_PASSWORD"
IFS= read -r SUDO_PASSWORD
[ -z "$SUDO_PASSWORD" ] && term_prompt error "$PROMPT_ERR_DEPS_INSTALL" && exit 1
CORRECT_SUDO_PASSWORD="$(tsudo whoami >/dev/null 2>&1 || printf 'no')"
[ "$CORRECT_SUDO_PASSWORD" = "no" ] && term_prompt error "$PROMPT_ERR_DEPS_INSTALL" && exit 1