tftpboot/scripts/download_debian.sh

63 lines
2.0 KiB
Bash
Raw Normal View History

2014-09-08 09:49:55 +02:00
#!/bin/bash
# This script do the following:
# Download Debian Stable (Stretch)
# Download Debian Testing (Buster)
# Download Debian oldStable (Jessie)
# Download Debian oldoldStable (Wheezy)
# Download Debian Unstable (Sid)
# Make an PXE's config file (aka menu.cfg)
2014-09-08 09:49:55 +02:00
if command -v in.tftpd > /dev/null; then
source /etc/default/tftpd-hpa
else
TFTP_DIRECTORY="/srv/tftp"
fi
2014-09-08 09:49:55 +02:00
DEBIAN_INSTALLER_DIR="${TFTP_DIRECTORY}/installer/debian"
DEBIAN_CONFIG_PXE="${DEBIAN_INSTALLER_DIR}/menu.cfg.example"
# Create directories and config file
rm -rf "${DEBIAN_INSTALLER_DIR}"
mkdir -p "${DEBIAN_INSTALLER_DIR}"
touch "${DEBIAN_CONFIG_PXE}"
2014-09-08 09:49:55 +02:00
for DISTRO in stretch buster jessie wheezy sid; do # For ALL Debian's version
2016-07-29 15:53:20 +02:00
for ARCH in amd64 i386; do # For all classic architecture
# Create and go into directory
mkdir -p ${DEBIAN_INSTALLER_DIR}/${DISTRO}/${ARCH}
2018-02-14 10:56:23 +01:00
pushd ${DEBIAN_INSTALLER_DIR}/${DISTRO}/${ARCH} > /dev/null
# Download files
2018-02-14 10:56:23 +01:00
#wget http://ftp.fr.debian.org/debian/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/debian-installer/${ARCH}/linux -O linux
#wget http://ftp.fr.debian.org/debian/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/debian-installer/${ARCH}/initrd.gz -O initrd.gz
wget --quiet http://ftp.fr.debian.org/debian/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/debian-installer/${ARCH}/linux -O linux
wget --quiet http://ftp.fr.debian.org/debian/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/debian-installer/${ARCH}/initrd.gz -O initrd.gz
popd > /dev/null
# Config file
/bin/cat >> "${DEBIAN_CONFIG_PXE}" << EOF
2016-07-29 15:53:20 +02:00
label ${DISTRO}${ARCH}
menu label Debian GNU/Linux ${DISTRO} ^${ARCH} bits
kernel installer/debian/${DISTRO}/${ARCH}/linux
append vga=normal initrd=installer/debian/${DISTRO}/${ARCH}/initrd.gz -- quiet
2014-09-08 09:49:55 +02:00
EOF
done
2014-09-08 09:49:55 +02:00
# Config file
/bin/cat >> "${DEBIAN_CONFIG_PXE}" << EOF
2014-09-08 09:49:55 +02:00
label separator
2016-07-29 15:53:20 +02:00
menu label ---
2014-09-08 09:49:55 +02:00
EOF
done
# Config file
/bin/cat >> "${DEBIAN_CONFIG_PXE}" << EOF
2014-09-08 09:49:55 +02:00
label mainmenu
2016-07-29 15:53:20 +02:00
menu label ^Back...
menu exit
2014-09-08 09:49:55 +02:00
EOF
exit 0