#! /usr/bin/env sh DOWNLOADDIR=/tmp/debian/wheezy/amd64 TFTPDIR=/srv/tftp/debian/wheezy PACKAGEDIR=amd64 TEMPDIR=/tmp/working if [ -e $TEMPDIR ] then rm -fR $TEMPDIR fi if [ -e $TFTPDIR/$PACKAGEDIR ] then rm -fR $TFTPDIR/$PACKAGEDIR fi mkdir -p $TFTPDIR # only execute this if file has not been downloaded if [ ! -e $DOWNLOADDIR/netboot.tar.gz ] then mkdir -p $DOWNLOADDIR cd $DOWNLOADDIR wget ftp://ftp.us.debian.org/debian/dists/wheezy/main/installer-amd64/current/images/netboot/netboot.tar.gz fi mkdir -p $TEMPDIR cd $TEMPDIR tar -xzvf $DOWNLOADDIR/netboot.tar.gz mv debian-installer/$PACKAGEDIR $TFTPDIR