fickit: Use DHCP during preparation and update

This commit is contained in:
nemunaire 2022-06-02 12:02:38 +02:00
commit 722295989c
3 changed files with 10 additions and 8 deletions

View file

@ -38,26 +38,28 @@ files:
BOOT_PART=/dev/sda1
fi
ip a add 10.10.10.5/29 dev eth0
ip link set eth0 up
udhcpc -i eth0
mkdir -p /boot
GW=$(ip r | grep default | awk '{ print $3 }')
# Wait e1000e launched
if ! ping -W 2 -c 1 10.10.10.6
if ! ping -W 2 -c 1 "${GW}"
then
sleep 4
fi
while ! ping -W 10 -c 1 10.10.10.6
while ! ping -W 10 -c 1 "${GW}"
do
echo "Unable to contact 10.10.10.6"
echo "Unable to contact ${GW}"
echo "Exit the shell when connection established."
/bin/ash
done
mount "${BOOT_PART}" /boot/ &&
/root/update_imgs ||
/root/update_imgs "${GW}" ||
/bin/ash
umount /boot &&