Commit 2992430d authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Add checking if package manager is running, introducing new file for functins ... rfc next time

parent 8590c46d
......@@ -33,6 +33,7 @@ fi
# load functions
[[ -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
......@@ -60,7 +61,7 @@ do
DIALOG_ESC=255
TITLELENGHT=${#MENUTITLE}
[[ "$TITLELENGHT" -lt 50 ]] && TITLELENGHT="50"
[[ "$TITLELENGHT" -lt 60 ]] && TITLELENGHT="60"
exec 3>&1
selection=$(dialog --colors --backtitle "$BACKTITLE" --title " armbian-config " --clear \
......
#!/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
}
This diff is collapsed.
......@@ -993,27 +993,4 @@ while true; do
jobs "$selection"
done
}
DIALOG_CANCEL=1
DIALOG_ESC=255
#-----------------------------------------------------------------------------------------------------------------------------------------#
# gather info about the board and start with loading menu
#
[[ -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=$KERNELID
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
}
\ No newline at end of file
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