tftpboot/scripts/old/download_ubuntu.sh

36 lines
1.3 KiB
Bash
Raw Normal View History

2014-09-08 09:49:55 +02:00
#!/bin/bash
# This script do the following:
# Download last Ubuntu LTS 16.04 (xenial)
# Download Ubuntu 17.10 (artful)
# Make a symlink to access to the last LTS
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
# last Long Term Support distribution name
LTS="focal"
2014-09-08 09:49:55 +02:00
for DISTRO in artful ${LTS}; do
for ARCH in amd64 i386; do
mkdir -p ${TFTP_DIRECTORY}/installer/ubuntu/${DISTRO}/${ARCH}
2018-02-14 10:56:23 +01:00
pushd ${TFTP_DIRECTORY}/installer/ubuntu/${DISTRO}/${ARCH} > /dev/null
#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
wget --quiet http://fr.archive.ubuntu.com/ubuntu/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/ubuntu-installer/${ARCH}/linux -O linux
wget --quiet http://fr.archive.ubuntu.com/ubuntu/dists/${DISTRO}/main/installer-${ARCH}/current/images/netboot/ubuntu-installer/${ARCH}/initrd.gz -O initrd.gz
popd > /dev/null
done
2014-09-08 09:49:55 +02:00
done
# Link the LTS distribution name to lts
if [ -L "${TFTP_DIRECTORY}/installer/ubuntu/lts" ]; then
unlink ${TFTP_DIRECTORY}/installer/ubuntu/lts
fi
ln -s ${LTS} ${TFTP_DIRECTORY}/installer/ubuntu/lts
exit 0