mirror of
https://github.com/armbian/build.git
synced 2025-08-14 15:16:58 +02:00
* Add shebangs for shellcheck See #AR-1406 * Add shebangs for shellcheck Also for `extensions` scripts
23 lines
534 B
Bash
23 lines
534 B
Bash
#!/usr/bin/env bash
|
|
# wait_for_package_manager
|
|
#
|
|
# * installation will break if we try to install when package manager is running
|
|
#
|
|
wait_for_package_manager() {
|
|
# exit if package manager is running in the back
|
|
while true; do
|
|
if [[ "$(
|
|
fuser /var/lib/dpkg/lock 2> /dev/null
|
|
echo $?
|
|
)" != 1 && "$(
|
|
fuser /var/lib/dpkg/lock-frontend 2> /dev/null
|
|
echo $?
|
|
)" != 1 ]]; then
|
|
display_alert "Package manager is running in the background." "Please wait! Retrying in 30 sec" "wrn"
|
|
sleep 30
|
|
else
|
|
break
|
|
fi
|
|
done
|
|
}
|