installer: add poweroff function, some cleanups

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2010-07-06 20:01:27 +02:00
parent e0afb6ef6b
commit b86123ed0c

View File

@ -160,7 +160,7 @@ function do_install_mbr() {
menu_main menu_main
;; ;;
255) 255)
echo 255 do_poweroff
;; ;;
esac esac
} }
@ -270,7 +270,7 @@ function do_install_quick() {
menu_main menu_main
;; ;;
255) 255)
echo 255 do_poweroff
;; ;;
esac esac
} }
@ -332,7 +332,7 @@ function menu_main() {
MSG_CANCEL="Reboot" MSG_CANCEL="Reboot"
dialog --colors --backtitle "$BACKTITLE" --cancel-label "$MSG_CANCEL" \ dialog --colors --backtitle "$BACKTITLE" --cancel-label "$MSG_CANCEL" \
--title "$MSG_TITLE" --menu "$MSG_MENU" 25 70 8 \ --title "$MSG_TITLE" --menu "$MSG_MENU" 20 70 5 \
1 "Quick Install OpenELEC.tv" \ 1 "Quick Install OpenELEC.tv" \
2 "Custom Install OpenELEC.tv" \ 2 "Custom Install OpenELEC.tv" \
3 "Setup OpenELEC.tv" \ 3 "Setup OpenELEC.tv" \
@ -348,11 +348,14 @@ function menu_main() {
3) menu_setup; break;; 3) menu_setup; break;;
4) menu_bios; break;; 4) menu_bios; break;;
5) logfile_show; break;; 5) logfile_show; break;;
esac;; esac
;;
1) 1)
do_reboot;; do_reboot
;;
255) 255)
echo 255;; do_poweroff
;;
esac esac
} }
@ -379,11 +382,14 @@ function menu_bios() {
case $ITEM_BIOSMENU in case $ITEM_BIOSMENU in
1) bios_backup; break;; 1) bios_backup; break;;
2) bios_update; break;; 2) bios_update; break;;
esac;; esac
;;
1) 1)
menu_main;; menu_main
;;
255) 255)
echo 255;; do_poweroff
;;
esac esac
} }
@ -418,6 +424,13 @@ function do_reboot() {
reboot reboot
} }
function do_poweroff() {
# powerdown on request
clear
sync
poweroff
}
# setup needed variables # setup needed variables
TMPDIR="/tmp/installer" TMPDIR="/tmp/installer"
BETA="yes" BETA="yes"