mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
Reboot and powering off with progressbar
This commit is contained in:
parent
acfaf4893c
commit
f9d278d55d
1 changed files with 14 additions and 10 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue