From 416e66e85f45d3ce2d1b2772ebd2b08a3708b850 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Tue, 28 Feb 2017 22:16:15 +0100 Subject: [PATCH] separate function exit_done() - final_check() produces ugly output when no partition is mounted - write log to target also only makes sense when a chroot is present --- lib/util-menu.sh | 18 +----------------- lib/util.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/lib/util-menu.sh b/lib/util-menu.sh index c2187b4..aef2814 100644 --- a/lib/util-menu.sh +++ b/lib/util-menu.sh @@ -44,25 +44,9 @@ main_menu_online() { ;; "8") edit_configs ;; - *) final_check - dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "$_CloseInstBody $(cat ${CHECKLIST})" 0 0 - if [[ $? -eq 0 ]]; then - echo "exit installer." >> ${LOGFILE} - if [[ -e /mnt/usr ]]; then - dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n$_LogInfo\n" 0 0 - if [[ $? -eq 0 ]]; then - [[ -e /mnt/.m-a.log ]] && cat ${LOGFILE} >> /mnt/.m-a.log - cp ${LOGFILE} /mnt/.m-a.log - fi - fi - umount_partitions - clear - exit 0 - fi + *) exit_done ;; esac - - main_menu_online } # Preparation diff --git a/lib/util.sh b/lib/util.sh index 74c99d5..52a62b4 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -429,3 +429,32 @@ final_check() { # check if user account has been generated [[ $(ls /mnt/home) == "" ]] && echo "- No user accounts have been generated" >> ${CHECKLIST} } + +exit_done() { + if [[ $(lsblk -o MOUNTPOINT | grep ${MOUNTPOINT}) != "" ]]; then + final_check + dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "$_CloseInstBody $(cat ${CHECKLIST})" 0 0 + if [[ $? -eq 0 ]]; then + echo "exit installer." >> ${LOGFILE} + dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "\n$_LogInfo\n" 0 0 + if [[ $? -eq 0 ]]; then + [[ -e /mnt/.m-a.log ]] && cat ${LOGFILE} >> /mnt/.m-a.log + cp ${LOGFILE} /mnt/.m-a.log + fi + umount_partitions + clear + exit 0 + else + main_menu_online + fi + else + dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "$_CloseInstBody" 0 0 + if [[ $? -eq 0 ]]; then + umount_partitions + clear + exit 0 + else + main_menu_online + fi + fi +}