tftpboot/scripts/download_ubuntu.sh

27 lines
899 B
Bash
Executable File

#!/bin/bash
# This script do the following:
# Download last Ubuntu LTS 16.04 (xenial)
# Download Ubuntu 15.10 (wily)
# Make a symlink to access to the last LTS
TFTP_ROOT="/var/lib/tftpboot"
# last Long Term Support distribution name
LTS="xenial"
for DISTRO in wily ${LTS}; do
for ARCH in amd64 i386; do
mkdir -p ${TFTP_ROOT}/installer/ubuntu/${DISTRO}/${ARCH}
pushd ${TFTP_ROOT}/installer/ubuntu/${DISTRO}/${ARCH}
wget http://fr.archive.ubuntu.com/ubuntu/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/ubuntu-installer/${ARCH}/linux -O linux
wget http://fr.archive.ubuntu.com/ubuntu/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/ubuntu-installer/${ARCH}/initrd.gz -O initrd.gz
popd
done
done
# Link the LTS distribution name to lts
unlink ${TFTP_ROOT}/installer/ubuntu/lts
ln -s ${LTS} ${TFTP_ROOT}/installer/ubuntu/lts
###########################