Skip to content

Instantly share code, notes, and snippets.

@CosmicToast
Created December 16, 2019 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CosmicToast/b9a8736c49a7035ae7cd69019a5e5b25 to your computer and use it in GitHub Desktop.
Save CosmicToast/b9a8736c49a7035ae7cd69019a5e5b25 to your computer and use it in GitHub Desktop.
Gets .kpxe and .efi boot endpoints of netboot.xyz, for use with dnsmasq.
#!/bin/sh
USER=dnsmasq:dnsmasq
MIRROR='https://boot.netboot.xyz/ipxe'
KPXE=netboot.xyz.kpxe
UEFI=netboot.xyz.efi
SHA2=netboot.xyz-sha256-checksums.txt
cd "$(dirname $0)"
rm -f "$KPXE" "$UEFI" "$SHA2"
wget "$MIRROR"/"$KPXE"
wget "$MIRROR"/"$UEFI"
wget "$MIRROR"/"$SHA2"
d="$(mktemp -d)"
for f in "$KPXE" "$UEFI"
do
grep "$f"$ "$SHA2" > "$d"/"$f".sha
sha256sum -c "$d"/"$f".sha || exit 1
done
rm -rf "$d"
chown "$USER" "$KPXE" "$UEFI" "$SHA2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment