tftpboot/scripts/download_diag_tools.sh

38 lines
929 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# This script do the following:
# Download Memtest
TFTP_ROOT="/var/lib/tftpboot"
# Config file
CONFIG_PXE="${TFTP_ROOT}/installer/menu.cfg.diag.example"
rm -f ${CONFIG_PXE} && touch ${CONFIG_PXE}
### Memtest {{{
MEMTEST_VERSION="5.01"
MEMTEST_URL="http://www.memtest.org/download/${MEMTEST_VERSION}/memtest86+-${MEMTEST_VERSION}.bin.gz"
MEMTEST_INSTALLER_DIR="${TFTP_ROOT}/installer/memtest/"
# (re)Create the installer directory
rm -rf ${MEMTEST_INSTALLER_DIR}
mkdir -p ${MEMTEST_INSTALLER_DIR}
pushd ${MEMTEST_INSTALLER_DIR}
# Download the last version and set simpler name (without the **.bin** extension!)
wget ${MEMTEST_URL} -O - | gzip -d > memtest86+-${MEMTEST_VERSION}.bin
ln -s memtest86+-${MEMTEST_VERSION}.bin memtest86+
popd
# Config file
/bin/cat >> "${CONFIG_PXE}" << EOF
label memtest
menu label ^Memory diagnostic tool (Memtest)
kernel installer/memtest/memtest86+
EOF
### }}}
exit 0