diff --git a/usr/lib/archboot/installer/base.sh b/usr/lib/archboot/installer/base.sh index d57e25e2e..7b30aae09 100644 --- a/usr/lib/archboot/installer/base.sh +++ b/usr/lib/archboot/installer/base.sh @@ -275,18 +275,22 @@ _mainmenu() { fi exit 0 elif [[ "${_EXIT}" == "2" ]]; then - _dialog --no-mouse --infobox "Rebooting in 10 seconds...\nDon't forget to remove the boot medium!" 4 50 - sleep 10 - clear - wall -n "Rebooting the system..." - sleep 3 + while true; do + sleep 1 + _COUNT=$((_COUNT+1)) + # abort after 10 seconds + _progress "$((_COUNT*10))" "Rebooting in $((10-_COUNT)) seconds. Don't forget to remove the boot medium!" + [[ "${_COUNT}" == 10 ]] && break + done | _dialog --title " System Reboot " --no-mouse --gauge "Rebooting in 10 seconds. Don't forget to remove the boot medium!" 6 75 0 reboot elif [[ "${_EXIT}" == "3" ]]; then - _dialog --no-mouse --infobox "Powering off in 10 seconds...\nDon't forget to remove the boot medium!" 4 50 - sleep 10 - clear - wall -n "Powering off the system..." - sleep 3 + while true; do + sleep 1 + _COUNT=$((_COUNT+1)) + # abort after 10 seconds + _progress "$((_COUNT*10))" "Powering off in $((10-_COUNT)) seconds. Don't forget to remove the boot medium!" + [[ "${_COUNT}" == 10 ]] && break + done | _dialog --title " System Shutdown " --no-mouse --gauge "Powering off in 10 seconds. Don't forget to remove the boot medium!" 6 75 0 poweroff fi ;; diff --git a/usr/lib/archboot/installer/common.sh b/usr/lib/archboot/installer/common.sh index dac666fbf..5cd512a4c 100644 --- a/usr/lib/archboot/installer/common.sh +++ b/usr/lib/archboot/installer/common.sh @@ -27,6 +27,39 @@ fi _PACMAN="pacman --root ${_DESTDIR} --cachedir=${_DESTDIR}/var/cache/pacman/pkg --noconfirm --noprogressbar" _MIRRORLIST="/etc/pacman.d/mirrorlist" +# $1: percentage +# $2: message +_progress() { +cat <