Split lib/general.sh

This commit is contained in:
hzy
2022-10-03 10:52:43 +08:00
committed by Ricardo Pardini
parent 14f4260bf9
commit d4c8dff4f0
18 changed files with 1793 additions and 1875 deletions

View File

@@ -0,0 +1,16 @@
# 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
}