Compaq BL10e Setting up a Linux PXE server and integrating clients - Page 16
import-to-tftpboot.sh file
UPC - 613326445501
View all Compaq BL10e manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 16 highlights
import-to-tftpboot.sh file The "import-to-tftpboot.sh" script imports a bootnet.img floppy into the /tftpboot directory and automatically renames the files based on the given name. #!/bin/sh TFTPBOOTDIR=/tftpboot PXELINUXDIR=$TFTPBOOTDIR/pxelinux.cfg TMPDIR=/tmp if [ -z "$2" ]; then echo This code will unpack a floppy image from location SOURCE into /tftpboot and will rename using the specified name; echo Usage: $0 SOURCE NAME; exit; fi SOURCE=$1 NAME=$2 # Create pxelinux.cfg directory if it does not exist. if [ ! -d $PXELINUXDIR ]; then mkdir -p $PXELINUXDIR; fi copyfiles() { # This section copies and renames all files except syslinux.cfg. FILES=`ls | grep -v syslinux.cfg` for X in $FILES; do cp -a $X $TFTPBOOTDIR/$NAME-$X; done # This section copies/renames syslinux.cfg and modifies it to point # correctly to the other copied/renamed files. for X in `ls | grep syslinux.cfg`; do sh /dev/null 2>&1 && { cd $SOURCE copyfiles cd / umount $SOURCE 16