#!/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. #-----------------------------------------------------------------------------------------------------------------------------------------# # gather info about the board and start with loading menu # DIALOG_CANCEL=1 DIALOG_ESC=255 [[ -f /etc/armbian-release ]] && source /etc/armbian-release && ARMBIAN="Armbian $VERSION $IMAGE_TYPE"; DISTRO=$(lsb_release -is) DISTROID=$(lsb_release -sc) KERNELID=$(uname -r) [[ -z "${ARMBIAN// }" ]] && ARMBIAN="$DISTRO $DISTROID" BACKTITLE="Configuration utility, $ARMBIAN, https://www.armbian.com" TITLE="$BOARD_NAME " DEFAULT_ADAPTER=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)') [[ -z "${DEFAULT_ADAPTER// }" ]] && DEFAULT_ADAPTER="lo" OVERLAYDIR="/boot/dtb/overlay"; [[ "$LINUXFAMILY" == "sunxi64" ]] && OVERLAYDIR="/boot/dtb/allwinner/overlay"; dialog --backtitle "$BACKTITLE" --title "Please wait" --infobox "\nLoading Armbian configuration utility ... " 5 45 sleep 1 #-----------------------------------------------------------------------------------------------------------------------------------------# # check if package manager is doing something # function is_package_manager_running() { fuser -s /var/lib/dpkg/lock if [[ $? = 0 ]]; then # 0 = true dialog --colors --title " \Z1Error\Z0 " --backtitle "$BACKTITLE" --no-collapse --msgbox \ "\n\Z1Package manager is running in the background. \n\nCan't proceed. Try again later." 9 53 return 0 else # 1 = false return 1 fi }