debian-config 1.82 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
	LIST+=( "Software" "System and 3rd party software install" )
19
	LIST+=( "Networking" "Wired, Wireless, Bluetooth, Access point" )
Igor Pecovnik's avatar
Igor Pecovnik committed
20
21
	LIST+=( "System" "General system settings" )
	LIST+=( "Armbian" "Armbian specific: overlays, MOTD, loglevel" )
Igor Pecovnik's avatar
Cleanup    
Igor Pecovnik committed
22
	LIST+=( "About" "Information about this configuration tool" )
23

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

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

Igor Pecovnik's avatar
RFC #2    
Igor Pecovnik committed
32
	exec 3>&1
Igor Pecovnik's avatar
Igor Pecovnik committed
33
	selection=$(dialog --backtitle "$BACKTITLE" --title " armbian-config " --clear \
Igor Pecovnik's avatar
Cleanup    
Igor Pecovnik committed
34
	--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
35
36
37
	"${LIST[@]}" 2>&1 1>&3)
	exit_status=$?
	exec 3>&-
Igor Pecovnik's avatar
Igor Pecovnik committed
38
	[[ $exit_status == $DIALOG_CANCEL || $exit_status == $DIALOG_ESC ]] && clear && exit
Igor Pecovnik's avatar
Igor Pecovnik committed
39

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

Igor Pecovnik's avatar
Igor Pecovnik committed
43
44
	"Software" )
		submenu_software
45
	;;
Igor Pecovnik's avatar
Igor Pecovnik committed
46
47
	"Networking" )
		submenu_networking
48
	;;
Igor Pecovnik's avatar
Igor Pecovnik committed
49
	"System" )
Igor Pecovnik's avatar
Igor Pecovnik committed
50
		submenu_settings
Igor Pecovnik's avatar
Igor Pecovnik committed
51
	;;
Igor Pecovnik's avatar
Igor Pecovnik committed
52
53
54
	"Armbian" )
		submenu_hardware
	;;
Igor Pecovnik's avatar
Cleanup    
Igor Pecovnik committed
55
56
57
	"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
58
	esac
Igor Pecovnik's avatar
Igor Pecovnik committed
59
done