debian-config 1.68 KB
Newer Older
Igor Pecovnik's avatar
RFC #2    
Igor Pecovnik committed
1
2
3
4
5
6
7
8
#!/bin/bash
#
# Copyright (c) 2017 Igor Pecovnik, igor.pecovnik@gma**.com
#
# This file is licensed under the terms of the GNU General Public
# License version 2. This program is licensed "as is" without any
# warranty of any kind, whether express or implied.

Igor Pecovnik's avatar
Igor Pecovnik committed
9

Igor Pecovnik's avatar
Igor Pecovnik committed
10
11
12
# load functions
source "$0""-submenu"
source "$0""-jobs"
13

Igor Pecovnik's avatar
Igor Pecovnik committed
14
# Main menu
Igor Pecovnik's avatar
Igor Pecovnik committed
15
16
while true; do
	LIST=()
17

Igor Pecovnik's avatar
Igor Pecovnik committed
18
19
20
	LIST+=( "Software" "System and 3rd party" )
	LIST+=( "Networking" "WiFI, BT, Hotspot" )
	LIST+=( "Settings" "Board and system settings" )
Igor Pecovnik's avatar
Cleanup    
Igor Pecovnik committed
21
	LIST+=( "About" "Information about this configuration tool" )
22

Igor Pecovnik's avatar
Igor Pecovnik committed
23
	# count number of menu items to adjust window sizee
Igor Pecovnik's avatar
Igor Pecovnik committed
24
	LISTLENGHT="$((9+${#LIST[@]}/2))"
Igor Pecovnik's avatar
Igor Pecovnik committed
25
	BOXLENGHT=${#LIST[@]}
Igor Pecovnik's avatar
RFC #2    
Igor Pecovnik committed
26

Igor Pecovnik's avatar
Igor Pecovnik committed
27
28
29
	# main dialog routine
	DIALOG_CANCEL=1
	DIALOG_ESC=255
30

Igor Pecovnik's avatar
RFC #2    
Igor Pecovnik committed
31
	exec 3>&1
Igor Pecovnik's avatar
Igor Pecovnik committed
32
	selection=$(dialog --backtitle "$BACKTITLE" --title "armbian-config" --clear \
Igor Pecovnik's avatar
Cleanup    
Igor Pecovnik committed
33
	--cancel-label "Exit to shell" --menu "\nConfiguration tool for the $BOARD_NAME running $DISTRO $DISTROID \n " $LISTLENGHT 70 $BOXLENGHT \
Igor Pecovnik's avatar
RFC #2    
Igor Pecovnik committed
34
35
36
	"${LIST[@]}" 2>&1 1>&3)
	exit_status=$?
	exec 3>&-
Igor Pecovnik's avatar
Igor Pecovnik committed
37
	[[ $exit_status == $DIALOG_CANCEL || $exit_status == $DIALOG_ESC ]] && clear && exit
Igor Pecovnik's avatar
Igor Pecovnik committed
38

Igor Pecovnik's avatar
Igor Pecovnik committed
39
	dialog --backtitle "$BACKTITLE" --title "Please wait" --infobox "\nLoading ${selection,,} submodule ... " 5 $((26+${#selection}))
Igor Pecovnik's avatar
RFC #2    
Igor Pecovnik committed
40
41
	case $selection in

Igor Pecovnik's avatar
Igor Pecovnik committed
42
43
	"Software" )
		submenu_software
44
	;;
Igor Pecovnik's avatar
Igor Pecovnik committed
45
46
	"Networking" )
		submenu_networking
47
	;;
Igor Pecovnik's avatar
Igor Pecovnik committed
48
49
	"Settings" )
		submenu_settings
Igor Pecovnik's avatar
Igor Pecovnik committed
50
	;;
Igor Pecovnik's avatar
Cleanup    
Igor Pecovnik committed
51
52
53
	"About" )
		show_box "Info" "This tool provides a straightforward way of doing initial configuration of the ${BOARD_NAME}. Although it can be run at any time, some of the options may have difficulties if you have heavily customised your installation.\n\nSources: https://github.com/armbian/config\n\nSupport: https://forum.armbian.com" "15"
	;;
Igor Pecovnik's avatar
RFC #2    
Igor Pecovnik committed
54
	esac
Igor Pecovnik's avatar
Igor Pecovnik committed
55
done