add end dialog on setup leaving

This commit is contained in:
Tobias Powalowski 2023-06-15 21:33:09 +02:00
parent 03c71882b0
commit 861a15316a

View file

@ -321,15 +321,28 @@ _mainmenu() {
"7") "7")
_install_bootloader ;; _install_bootloader ;;
"8") "8")
dialog ${_DEFAULT} --title " EXIT PROGRAM " --menu 11 58 8 \
"1" "Exit Program" \
"2" "Reboot System" \
"3" "Poweroff System" 2>${_ANSWER}
_ANSWER="$(cat ${_ANSWER})"
if [[ "${_ANSWER}" == "1" ]]; then
[[ -e /tmp/.setup-running ]] && rm /tmp/.setup-running [[ -e /tmp/.setup-running ]] && rm /tmp/.setup-running
clear clear
if mountpoint -q /install; then if mountpoint -q /install; then
echo "" echo ""
echo "If the installation finished successfully, you can now type 'reboot'" echo "If the installation finished successfully:"
echo "Remove the boot medium and type 'reboot'"
echo "to restart the system." echo "to restart the system."
echo "" echo ""
fi fi
exit 0 ;; exit 0
elif [[ "${_ANSWER}" == "2" ]]; then
reboot
elif "[[ ${_ANSWER}" == "3" ]]; then
poweroff
fi
;;
*) *)
if _dialog --yesno "Abort Program?" 6 40; then if _dialog --yesno "Abort Program?" 6 40; then
[[ -e /tmp/.setup-running ]] && rm /tmp/.setup-running [[ -e /tmp/.setup-running ]] && rm /tmp/.setup-running