Allow multiple entries for debian and match IPv4 more strictly

This commit is contained in:
Raphael Dannecker 2025-10-29 16:40:12 +01:00
parent 148a478121
commit f95b220aa0

View file

@ -5,11 +5,11 @@
set -eu set -eu
cur="$(efibootmgr | grep -Ei 'BootOrder:' | \ cur="$(efibootmgr | grep -Ei 'BootOrder:' | \
sed -E 's/^BootOrder: ([[:xdigit:]]{4}),.+$/\1/')" sed -E 's/^BootOrder: ([[:xdigit:]]{4}),.+$/\1/')"
pxeip4="$(efibootmgr | grep -Ei "IP.*4" | \ pxeip4="$(efibootmgr | grep -Ei "IP.{0,5}4" | \
sed -E 's/^Boot([[:xdigit:]]{4}).+$/\1/')" sed -E 's/^Boot([[:xdigit:]]{4}).+$/\1/' | paste -sd, -)"
debian="$(efibootmgr | grep -Ei "debian" | \ debian="$(efibootmgr | grep -Ei "debian" | \
sed -E 's/^Boot([[:xdigit:]]{4}).+$/\1/')" sed -E 's/^Boot([[:xdigit:]]{4}).+$/\1/' | paste -sd, -)"
if [[ "$cur" != "$pxeip4" ]] && [[ -n "$pxeip4" ]] && [[ -n "$debian" ]] ; then if [[ "$cur" != "$pxeip4" ]] && [[ -n "$pxeip4" ]] && [[ -n "$debian" ]] ; then
efibootmgr -o $pxeip4,$debian efibootmgr -o $pxeip4,$debian