mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +00:00
Some tweaks to the new dpkg lock detector
This commit is contained in:
parent
2c762899de
commit
a535ca9db4
1 changed files with 5 additions and 20 deletions
|
@ -90,27 +90,12 @@ if command -v apt-get &> /dev/null; then
|
|||
test_dpkg_lock() {
|
||||
i=0
|
||||
while fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
|
||||
echo -en "\r::: Waiting for package manager to finish"
|
||||
j=0
|
||||
while [ $j -lt 6 ]; do
|
||||
if [ $j -lt $i ]; then
|
||||
echo -n "."
|
||||
else
|
||||
echo -n " "
|
||||
fi
|
||||
((j=j+1))
|
||||
done
|
||||
sleep 0.5
|
||||
if [ $i -lt 6 ]; then
|
||||
((i=i+1))
|
||||
else
|
||||
i=0
|
||||
fi
|
||||
((i=i+1))
|
||||
done
|
||||
# Add final newline only if we entered the loop at least once
|
||||
if [ $j -gt 0 ]; then
|
||||
echo ""
|
||||
fi
|
||||
# Always return success, since we only return if there is no
|
||||
# lock (anymore)
|
||||
return 0
|
||||
}
|
||||
|
||||
elif command -v rpm &> /dev/null; then
|
||||
|
@ -764,7 +749,7 @@ update_package_cache() {
|
|||
|
||||
echo ":::"
|
||||
echo -n "::: Updating local cache of available packages..."
|
||||
if eval ${UPDATE_PKG_CACHE} &> /dev/null; then
|
||||
if eval "${UPDATE_PKG_CACHE}" &> /dev/null; then
|
||||
echo " done!"
|
||||
else
|
||||
echo -n "\n!!! ERROR - Unable to update package cache. Please try \"${UPDATE_PKG_CACHE}\""
|
||||
|
|
Loading…
Reference in a new issue