fix wait_container

This commit is contained in:
Kay0u 2020-08-15 10:58:35 +02:00
parent 0a81acd8e5
commit 975177ebcc
No known key found for this signature in database
GPG key ID: AE1DCADB6415A156

View file

@ -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