Add helper script wait_network

This commit is contained in:
Benoit 2024-10-24 18:20:15 +09:00
parent 537481a849
commit e8cd68c722
Signed by: Benoit
SSH key fingerprint: SHA256:kFsX94Kq6z/6CY0dX+7/FpAeJC0QlMhJVY+B7NYrOmA
4 changed files with 9 additions and 6 deletions

View file

@ -17,8 +17,7 @@ ALIAS="$UPSTREAM_NAME-$UPSTREAM_VER-$SERIAL"
cd $WORKSPACE
incus launch images:$IMAGE $CNAME --quiet
# Wait for network
timeout 30 bash -c "until incus exec $CNAME -- ping -c1 google.com &>/dev/null; do sleep 1; done"
wait_network $CNAME
# Forgejo
incus exec $CNAME -- mkdir /etc/esh

View file

@ -17,8 +17,7 @@ ALIAS="$UPSTREAM_NAME-$UPSTREAM_VER-$SERIAL"
cd "$WORKSPACE"
incus launch images:$IMAGE "$CNAME" --quiet
# Wait for network
timeout 30 bash -c "until incus exec $CNAME -- ping -c1 google.com &>/dev/null; do sleep 1; done"
wait_network $CNAME
# Mastodon
incus exec "$CNAME" -- bash -c '

View file

@ -17,8 +17,7 @@ ALIAS="$UPSTREAM_NAME-$UPSTREAM_VER-$SERIAL"
cd $WORKSPACE
incus launch images:$IMAGE $CNAME --quiet
# Wait network
sleep 5
wait_network $CNAME
# Navidrome
incus exec $CNAME -- mkdir /etc/esh

6
cfg/scripts/wait_network Normal file
View file

@ -0,0 +1,6 @@
#!/bin/env bash
# Upstream doc: https://www.navidrome.org/docs/installation/linux/
set -euxo pipefail
CNAME="$1"
timeout 30 bash -c "until incus exec $CNAME -- ping -c1 google.com &>/dev/null; do sleep 1; done"