diff --git a/lib/util-menu.sh b/lib/util-menu.sh index 32a577d..a756854 100644 --- a/lib/util-menu.sh +++ b/lib/util-menu.sh @@ -253,7 +253,7 @@ install_acc_menu() { # If something has been selected, install if [[ $(cat ${PACKAGES}) != "" ]]; then basestrap ${MOUNTPOINT} ${PACKAGES} 2>$ERR - check_for_error "$FUNCNAME" $? + check_for_error "$FUNCNAME" $? || return $? fi } @@ -329,7 +329,7 @@ edit_configs() { if [[ $FILE == "${MOUNTPOINT}/etc/mkinitcpio.conf" ]]; then dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --yesno "${_MMRunMkinit}?" 0 0 && { run_mkinitcpio 2>$ERR - check_for_error "run_mkinitcpio" "$?" edit_configs + check_for_error "run_mkinitcpio" $? } fi else diff --git a/lib/util.sh b/lib/util.sh index c0f3e4c..266db83 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -166,10 +166,12 @@ check_for_error() { echo -e "$(date +%D\ %T) ERROR ${_msg} ${_fpath}" >> "${LOGFILE}" if [[ "${_function_menu}" != "SKIP" ]]; then DIALOG " $_ErrTitle " --msgbox "\n${_msg}\n" 0 0 -# ($_function_menu) + # return error for return to parent menu + return $_err fi else - echo -e "$(date +%D\ %T) ${_msg}" >> "${LOGFILE}" + # add $FUNCNAME limit to 20 max for control if recursive + echo -e "$(date +%D\ %T) ${_msg} --${FUNCNAME[*]:1:20}" >> "${LOGFILE}" fi }