1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-17 21:59:55 +00:00

Let users know what's going on

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2022-04-04 16:48:34 +02:00
parent cd3c97f113
commit 30ba79f6a0
No known key found for this signature in database
GPG Key ID: 4CDA6F249DD2B485

View File

@ -262,6 +262,7 @@ os_check() {
# This function waits for dpkg to unlock, which signals that the previous apt-get command has finished.
test_dpkg_lock() {
i=0
printf " %b Waiting for package manager to finish\\n" "${INFO}"
# fuser is a program to show which processes use the named files, sockets, or filesystems
# So while the lock is held,
while fuser /var/lib/dpkg/lock >/dev/null 2>&1
@ -272,7 +273,8 @@ test_dpkg_lock() {
((i=i+1))
# exit if waiting for more then 30 seconds
if [[ $i -gt 60 ]]; then
echo "*** Error: Could not verify package manager finished and released lock. Attempt to install packages manually and retry.";
printf " %b %bError: Could not verify package manager finished and released lock. %b\\n" "${CROSS}" "${COL_LIGHT_RED}" "${COL_NC}"
printf " Attempt to install packages manually and retry.\\n"
exit 1;
fi
done