diff --git a/usr/bin/archboot-launcher.sh b/usr/bin/archboot-launcher.sh index 4b2ab3fbd..9030ab0b0 100755 --- a/usr/bin/archboot-launcher.sh +++ b/usr/bin/archboot-launcher.sh @@ -77,18 +77,22 @@ _exit() { _show_login 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 " --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 " --no-mouse --gauge "Powering off in 10 seconds. Don't forget to remove the boot medium!" 6 75 0 poweroff fi }