Skip to content

Commit

Permalink
scripts: Retry Cloud Hypervisor binary download
Browse files Browse the repository at this point in the history
Signed-off-by: Akira Moroo <retrage01@gmail.com>
  • Loading branch information
retrage authored and rbradford committed Dec 14, 2023
1 parent c3d6de6 commit d98f674
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/fetch_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ fetch_ch() {
[ "$CH_ARCH" = "x86_64" ] && CH_NAME="cloud-hypervisor"
CH_URL="$CH_URL_BASE/$CH_NAME"

WGET_RETRY_MAX=10
WGET_RETRY=0

until [ "$WGET_RETRY" -ge "$WGET_RETRY_MAX" ]; do
wget --quiet $CH_URL -O $CH_PATH && break
WGET_RETRY=$[$WGET_RETRY+1]
done

if [ "$WGET_RETRY" -ge "$WGET_RETRY_MAX" ]; then
echo "Failed to download $CH_URL"
exit 1
fi

wget --quiet $CH_URL -O $CH_PATH
chmod +x $CH_PATH
sudo setcap cap_net_admin+ep $CH_PATH
Expand Down

0 comments on commit d98f674

Please sign in to comment.