Skip to content

Instantly share code, notes, and snippets.

@brycied00d
Created October 31, 2012 22:08
Show Gist options
  • Save brycied00d/3990271 to your computer and use it in GitHub Desktop.
Save brycied00d/3990271 to your computer and use it in GitHub Desktop.
Script to download the latest netboot/net-install files for CentOS
#!/bin/bash
MIRROR=mirrors.us.kernel.org
ROOTDIR=/home/image/boot/
#wget -N http://$MIRROR/centos/5/os/i386/images/pxeboot/initrd.img http://$MIRROR/centos/5/os/i386/images/pxeboot/vmlinuz
#wget -N http://$MIRROR/centos/5/os/x86_64/images/pxeboot/initrd.img http://$MIRROR/centos/5/os/x86_64/images/pxeboot/vmlinuz
#wget -N http://$MIRROR/centos/6/os/i386/images/pxeboot/initrd.img http://$MIRROR/centos/6/os/i386/images/pxeboot/vmlinuz
#wget -N http://$MIRROR/centos/6/os/x86_64/images/pxeboot/initrd.img http://$MIRROR/centos/6/os/x86_64/images/pxeboot/vmlinuz
# Starting with RHEL 7, there are only x86_64 releases (no i386)
for REL in 7
do
for ARCH in x86_64
do
echo "Sync'ing CentOS $REL / $ARCH..."
mkdir -p $ROOTDIR/CentOS/CentOS-$REL/$ARCH/
cd $ROOTDIR/CentOS/CentOS-$REL/$ARCH/ && wget -N http://$MIRROR/centos/$REL/os/$ARCH/images/pxeboot/initrd.img http://$MIRROR/centos/$REL/os/$ARCH/images/pxeboot/vmlinuz
done
done
for REL in 6 5 #4
do
for ARCH in i386 x86_64
do
echo "Sync'ing CentOS $REL / $ARCH..."
mkdir -p $ROOTDIR/CentOS/CentOS-$REL/$ARCH/
cd $ROOTDIR/CentOS/CentOS-$REL/$ARCH/ && wget -N http://$MIRROR/centos/$REL/os/$ARCH/images/pxeboot/initrd.img http://$MIRROR/centos/$REL/os/$ARCH/images/pxeboot/vmlinuz
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment