#!/bin/bash echo "Generating pxelinux for your configs" rm pxeconfigs/* rm /var/lib/tftpboot/pxelinux/pxelinux.cfg/01* function gen_file_config { role=$1 mac=$(echo $2 | sed 's/\:/\-/g') arp_type="01" image=$3 disk_type=$4 echo "#$2 timeout 1200 ui vesamenu.c32 menu title Infidel's PXE boot Manager # Background image *must* be the same resolution as the resolution here. MENU RESOLUTION 640 480 MENU BACKGROUND bg.png # White on a black/transparent background. MENU COLOR screen * #ffffffff #00000000 std # Blue borders on a black/transparent background. # Borders have padding, so that background matters. MENU COLOR border * #ff0000ff #00000000 std # Title bar is cyan on a black/transparent background. MENU COLOR title * #ff00ffff #00000000 std # Selection bar is white on a magenta/opaque background. MENU COLOR sel * #ffffffff #ffff00ff none # Unselected menu items are white on black/transparent. MENU COLOR unsel * #ffffffff #00000000 std # menu resolution 604 455 # menu background bg.png # default $role default localboot prompt 0 label $role menu label Ignite Openshift: $role < $2 > KERNEL fcos-37-pxe/fcos-live-kernel.x86_64 APPEND initrd=fcos-37-pxe/fcos-initramfs.x86_64.img,fcos-37-pxe/fcos-live-rootfs.x86_64.img coreos.inst.install_dev=/dev/$disk_type coreos.inst.image_url=http://192.168.22.1:8080/images/$image coreos.inst.insecure=yes coreos.inst.ignition_url=http://192.168.22.1:8080/okd-inf/$role.ign ignition.firstboot ignition.platform.id=metal label localboot menu label Boot from Local Drive localboot 0 menu end " > pxeconfigs/$arp_type'-'$mac } while IFS="," read -r role mac image disk_type do echo $role ' ---> ' $mac ' Finished ' gen_file_config $role $mac $image $disk_type done < <( cat mac-lists.csv ) cp -R pxeconfigs/* /var/lib/tftpboot/pxelinux/pxelinux.cfg/