From b0f9b75d8f57b830f4422c4f3b4078f91ac0acc3 Mon Sep 17 00:00:00 2001 From: Mykola Malkov Date: Thu, 5 Apr 2018 16:16:45 +0200 Subject: [PATCH] TT#32751 Fix stdout issue with dialog utility Dialog with --stdout can't reopen terminal in grml 2017.05 Change-Id: Ic3e814c190f696c7e822b9eaf3311437582951a7 --- templates/scripts/main.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/templates/scripts/main.sh b/templates/scripts/main.sh index f766824..e06d9f3 100755 --- a/templates/scripts/main.sh +++ b/templates/scripts/main.sh @@ -103,13 +103,16 @@ prompt_for_target() echo "${i}" "${disk_info}" done) ) - if ! TARGET_DISK=$(dialog --title "Disk selection" --single-quoted --stdout \ - --ok-label OK --cancel-label Exit \ - --menu "Please select the target disk for installing Debian/ngcp:" 0 0 0 \ - "${DISK_LIST[@]}") ; then + TMP=$(mktemp) + if ! dialog --title "Disk selection" --single-quoted \ + --ok-label OK --cancel-label Exit \ + --menu "Please select the target disk for installing Debian/ngcp:" 0 0 0 \ + "${DISK_LIST[@]}" 2>"${TMP}" ; then + rm -f "${TMP}" ewarn "Cancelling as requested by user during disk selection." ; eend 0 return 1 fi + TARGET_DISK="$(cat "${TMP}")"; rm -f "${TMP}" } # }}}