2023-09-07 10:59:30 +02:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
#
|
|
|
|
|
# fix boot order: first PXE, then Debian
|
|
|
|
|
#
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
|
|
cur="$(efibootmgr | grep -Ei 'BootOrder:' | \
|
2026-08-05 13:05:20 +02:00
|
|
|
sed -E 's/^BootOrder: ([[:xdigit:]]{4}),.+$/\1/')"
|
|
|
|
|
pxeip4="$(efibootmgr | grep -Ei "IP.{0,5}4" | \
|
|
|
|
|
sed -E 's/^Boot([[:xdigit:]]{4}).+$/\1/' | paste -sd, -)"
|
2023-09-07 10:59:30 +02:00
|
|
|
debian="$(efibootmgr | grep -Ei "debian" | \
|
2026-08-05 13:05:20 +02:00
|
|
|
sed -E 's/^Boot([[:xdigit:]]{4}).+$/\1/' | paste -sd, -)"
|
2023-09-07 10:59:30 +02:00
|
|
|
|
|
|
|
|
if [[ "$cur" != "$pxeip4" ]] && [[ -n "$pxeip4" ]] && [[ -n "$debian" ]] ; then
|
|
|
|
|
efibootmgr -o $pxeip4,$debian
|
|
|
|
|
else
|
|
|
|
|
echo "Nothing to do."
|
|
|
|
|
fi
|