Import-To-Tftpboot.sh File - Compaq BL10e - HP ProLiant - 512 MB RAM Troubleshooting Manual

Setting up a linux pxe server and integrating clients
Hide thumbs Also See for BL10e - HP ProLiant - 512 MB RAM:
Table of Contents

Advertisement

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 <<-EOF > $PXELINUXDIR/$NAME-$X
`echo -ne "cat $X | sed"
for Y in $FILES; do
echo -ne " -e \"s,${Y}$\|${Y}[^=],$NAME-&,g\""
done`
EOF
done
}
# This section attempts to locate the specified files for copying purposes.
if [ -d $SOURCE ]; then
if [ `ls $SOURCE | wc -l` -eq 0 ]; then
# If SOURCE dir is empty, then attempt to mount that dir.
mount | grep $SOURCE ||
{
mount $SOURCE >/dev/null 2>&1 && {
cd $SOURCE
copyfiles
cd /
umount $SOURCE
16

Advertisement

Table of Contents
loading

This manual is also suitable for:

Bl10e - proliant - g2Bl10e 512

Table of Contents