From b86123ed0cbadf0c31eac2a3f397365465994657 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Tue, 6 Jul 2010 20:01:27 +0200 Subject: [PATCH] installer: add poweroff function, some cleanups Signed-off-by: Stephan Raue --- packages/tools/installer/scripts/installer | 31 +++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/packages/tools/installer/scripts/installer b/packages/tools/installer/scripts/installer index 3e28847b3a..30d033eb4c 100755 --- a/packages/tools/installer/scripts/installer +++ b/packages/tools/installer/scripts/installer @@ -160,7 +160,7 @@ function do_install_mbr() { menu_main ;; 255) - echo 255 + do_poweroff ;; esac } @@ -270,7 +270,7 @@ function do_install_quick() { menu_main ;; 255) - echo 255 + do_poweroff ;; esac } @@ -332,7 +332,7 @@ function menu_main() { MSG_CANCEL="Reboot" 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" \ 2 "Custom Install OpenELEC.tv" \ 3 "Setup OpenELEC.tv" \ @@ -348,11 +348,14 @@ function menu_main() { 3) menu_setup; break;; 4) menu_bios; break;; 5) logfile_show; break;; - esac;; + esac + ;; 1) - do_reboot;; + do_reboot + ;; 255) - echo 255;; + do_poweroff + ;; esac } @@ -379,11 +382,14 @@ function menu_bios() { case $ITEM_BIOSMENU in 1) bios_backup; break;; 2) bios_update; break;; - esac;; + esac + ;; 1) - menu_main;; + menu_main + ;; 255) - echo 255;; + do_poweroff + ;; esac } @@ -418,6 +424,13 @@ function do_reboot() { reboot } +function do_poweroff() { + # powerdown on request + clear + sync + poweroff +} + # setup needed variables TMPDIR="/tmp/installer" BETA="yes"