Commit d2ab5b5d authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Include local functions first, adding functions names at the beggining of the file

parent 87f42dec
...@@ -30,12 +30,30 @@ fi ...@@ -30,12 +30,30 @@ fi
#-----------------------------------------------------------------------------------------------------------------------------------------# #-----------------------------------------------------------------------------------------------------------------------------------------#
# load functions # load functions, local first
[[ -f /usr/lib/armbian-config/jobs.sh ]] && source /usr/lib/armbian-config/jobs.sh || source ${BASH_SOURCE}-jobs
[[ -f /usr/lib/armbian-config/submenu.sh ]] && source /usr/lib/armbian-config/submenu.sh || source ${BASH_SOURCE}-submenu
[[ -f /usr/lib/armbian-config/functions.sh ]] && source /usr/lib/armbian-config/functions.sh || source ${BASH_SOURCE}-functions
[[ -f /usr/lib/armbian-config/functions-network.sh ]] && source /usr/lib/armbian-config/functions-network.sh || source ${BASH_SOURCE}-functions-network
if [[ -f ${BASH_SOURCE}-jobs ]]; then source ${BASH_SOURCE}-jobs;
elif [[ -f /usr/lib/armbian-config/jobs.sh ]]; then source /usr/lib/armbian-config/jobs.sh;
else exit 1;
fi
if [[ -f ${BASH_SOURCE}-submenu ]]; then source ${BASH_SOURCE}-submenu;
elif [[ -f /usr/lib/armbian-config/submenu.sh ]]; then source /usr/lib/armbian-config/submenu.sh;
else exit 1;
fi
sleep 1
if [[ -f ${BASH_SOURCE}-functions ]]; then source ${BASH_SOURCE}-functions;
elif [[ -f /usr/lib/armbian-config/functions.sh ]]; then source /usr/lib/armbian-config/functions.sh;
else exit 1;
fi
if [[ -f ${BASH_SOURCE}-functions-network ]]; then source ${BASH_SOURCE}-functions-network;
elif [[ -f /usr/lib/armbian-config/functions-network.sh ]]; then source /usr/lib/armbian-config/functions-network.sh;
else exit 1;
fi
# collect info
main "$@"
#-----------------------------------------------------------------------------------------------------------------------------------------# #-----------------------------------------------------------------------------------------------------------------------------------------#
......
...@@ -6,8 +6,20 @@ ...@@ -6,8 +6,20 @@
# License version 2. This program is licensed "as is" without any # License version 2. This program is licensed "as is" without any
# warranty of any kind, whether express or implied. # warranty of any kind, whether express or implied.
# Functions:
# main
# check_if_installed
# is_package_manager_running
# display_qr_code
# beta_disclaimer
# show_box
# description
# aval_kernel
# aval_dtbs
# get_a20modes
# get_h3modes
# add_choose_user
# configure_desktop
# #
# gather info about the board and start with loading menu # gather info about the board and start with loading menu
...@@ -371,4 +383,3 @@ function configure_desktop () ...@@ -371,4 +383,3 @@ function configure_desktop ()
main "$@"
\ No newline at end of file
...@@ -6,7 +6,26 @@ ...@@ -6,7 +6,26 @@
# License version 2. This program is licensed "as is" without any # License version 2. This program is licensed "as is" without any
# warranty of any kind, whether express or implied. # warranty of any kind, whether express or implied.
# Functions:
# check_hostapd
# check_advanced_modes
# create_if_config
# reload-nety
# check_port
# check_ht_capab
# check_vht_capab
# check_channels
# nm_ip_editor
# systemd_ip_editor
# ip_editor
# wlan_edit_basic
# wlan_edit
# exceptions
# wlan_exceptions
# check_and_warn
# get_wlan_interface
# select_default_interface
# connect_bt_interface
# #
...@@ -121,7 +140,7 @@ function reload-nety() { ...@@ -121,7 +140,7 @@ function reload-nety() {
# #
# Check if something is running on port $1 and display info # Check if something is running on port $1 and display info
# #
check_port () function check_port ()
{ {
[[ -n $(netstat -lnt | awk '$6 == "LISTEN" && $4 ~ ".'$1'"') ]] && dialog --backtitle "$BACKTITLE" --title "Checking service" \ [[ -n $(netstat -lnt | awk '$6 == "LISTEN" && $4 ~ ".'$1'"') ]] && dialog --backtitle "$BACKTITLE" --title "Checking service" \
--msgbox "\nIt looks good.\n\nThere is $2 service on port $1" 9 52 --msgbox "\nIt looks good.\n\nThere is $2 service on port $1" 9 52
......
...@@ -21,7 +21,7 @@ function jobs () ...@@ -21,7 +21,7 @@ function jobs ()
# Application installer # Application installer
# #
"Softy" ) "Softy" )
softy ./softy || softy
;; ;;
# Remove BT # Remove BT
......
...@@ -6,7 +6,11 @@ ...@@ -6,7 +6,11 @@
# License version 2. This program is licensed "as is" without any # License version 2. This program is licensed "as is" without any
# warranty of any kind, whether express or implied. # warranty of any kind, whether express or implied.
# Functions:
# submenu_settings
# submenu_networking
# submenu_personal
# submenu_software
#-----------------------------------------------------------------------------------------------------------------------------------------# #-----------------------------------------------------------------------------------------------------------------------------------------#
# system # system
...@@ -261,7 +265,7 @@ function submenu_software () ...@@ -261,7 +265,7 @@ function submenu_software ()
while true; do while true; do
LIST=() LIST=()
[[ -f /usr/bin/softy ]] && LIST+=( "Softy" "3rd party applications installer" ) [[ -f /usr/bin/softy || -f softy ]] && LIST+=( "Softy" "3rd party applications installer" )
[[ -f /usr/bin/h3consumption && "$LINUXFAMILY" = "sun8i" && "$BRANCH" = "default" ]] && \ [[ -f /usr/bin/h3consumption && "$LINUXFAMILY" = "sun8i" && "$BRANCH" = "default" ]] && \
LIST+=( "Consumption" "Control board consumption" ) LIST+=( "Consumption" "Control board consumption" )
[[ -f /usr/bin/armbianmonitor ]] && LIST+=( "Monitor" "Simple CLI board monitoring" ) [[ -f /usr/bin/armbianmonitor ]] && LIST+=( "Monitor" "Simple CLI board monitoring" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment