From 975177ebcc58c66d9306a6dfa3a8124b2f52ebc2 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sat, 15 Aug 2020 10:58:35 +0200 Subject: [PATCH] fix wait_container --- utils.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils.sh b/utils.sh index 1d5066e..acdd478 100755 --- a/utils.sh +++ b/utils.sh @@ -60,7 +60,7 @@ wait_container() # Wait for container to access the internet for j in $(seq 1 10); do - if lxc exec "$1" -- /bin/bash -c "wget -q --spider http://github.com"; then + if lxc exec "$1" -- /bin/bash -c "which wget > /dev/null 2>&1 && wget -q --spider http://github.com"; then break fi @@ -76,7 +76,9 @@ wait_container() # Wait dpkg for j in $(seq 1 10); do - if ! lxc exec "$1" -- /bin/bash -c "fuser /var/lib/dpkg/lock > /dev/null 2>&1"; then + if ! lxc exec "$1" -- /bin/bash -c "fuser /var/lib/dpkg/lock > /dev/null 2>&1" && + ! lxc exec "$1" -- /bin/bash -c "fuser /var/lib/dpkg/lock-frontend > /dev/null 2>&1" && + ! lxc exec "$1" -- /bin/bash -c "fuser /var/cache/apt/archives/lock > /dev/null 2>&1"; then break fi