forked from mdrjr/odroid-utility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainmenu.sh
47 lines (38 loc) · 1.37 KB
/
mainmenu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
while true; do
menu_items[0]="1"; menu_items[1]="HDMI Configuration"
menu_items[2]="2"; menu_items[3]="Update your Kernel/Firmware"
menu_items[4]="3"; menu_items[5]="Install/Update XBMC (Ubuntu Only)"
menu_items[6]="4"; menu_items[7]="Resize your root partition"
menu_items[8]="5"; menu_items[9]="Xorg On/Off"
menu_items[10]="6"; menu_items[11]="Rebuild Xorg DDX (fixes ABI errors)"
menu_items[12]="7"; menu_items[13]="Change Hostname"
menu_items[18]="10"; menu_items[19]="Pulse Audio Control (on/off)"
if [ "$BOARD" = "odroidc" ]; then
# LIRC Menu
menu_items[14]="8"; menu_items[15]="Install LIRC"
# HDMI Passthru Configuration
menu_items[16]="9"; menu_items[17]="HDMI Passthrough (On/Off)"
fi
CC=$(whiptail --backtitle "Hardkernel ODROID Utility v$_REV" --menu "Main Menu" 0 0 1 --cancel-button "Exit" --ok-button "Select" \
"${menu_items[@]}" \
3>&1 1>&2 2>&3)
RET=$?
if [ $RET -eq 1 ]; then
do_exit
elif [ $RET -eq 0 ]; then
case "$CC" in
"1") setup_hdmi ;;
"2") kernel_update ;;
"3") xbmc_setup ;;
"4") fs_resize ;;
"5") xorg_config ;;
"6") rebuild_armsoc ;;
"7") change_hostname ;;
"8") lirc_setup ;;
"9") odroidc1_hdmipass ;;
"10") pulseaudio_control_onoff ;;
*) msgbox "Error 001. Please report on the forums" && exit 0 ;;
esac || msgbox "I don't know how you got here! >> $CC << Report on the forums"
fi
done