Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
2992430d
Commit
2992430d
authored
Apr 09, 2018
by
Igor Pecovnik
Browse files
Add checking if package manager is running, introducing new file for functins ... rfc next time
parent
8590c46d
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
debian-config
View file @
2992430d
...
...
@@ -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
5
0
]]
&&
TITLELENGHT
=
"
5
0"
[[
"
$TITLELENGHT
"
-lt
6
0
]]
&&
TITLELENGHT
=
"
6
0"
exec
3>&1
selection
=
$(
dialog
--colors
--backtitle
"
$BACKTITLE
"
--title
" armbian-config "
--clear
\
...
...
debian-config-functions
0 → 100644
View file @
2992430d
#!/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
"
\n
Loading 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
"
\Z
1Error
\Z
0 "
--backtitle
"
$BACKTITLE
"
--no-collapse
--msgbox
\
"
\n\Z
1Package manager is running in the background.
\n\n
Can't proceed. Try again later."
9 53
return
0
else
# 1 = false
return
1
fi
}
debian-config-jobs
View file @
2992430d
This diff is collapsed.
Click to expand it.
debian-config-submenu
View file @
2992430d
...
...
@@ -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
"
\n
Loading Armbian configuration utility ... "
5 45
sleep
1
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment