Skip to content

Instantly share code, notes, and snippets.

@tskrynnyk
Created August 24, 2012 11:18
Show Gist options
  • Select an option

  • Save tskrynnyk/3449329 to your computer and use it in GitHub Desktop.

Select an option

Save tskrynnyk/3449329 to your computer and use it in GitHub Desktop.
Debian ISO weekly builds
#! /bin/bash
# Debian ISO weekly builds
#
#set -x
DEBIAN_ISO_URL=(
http://cdimage.debian.org/cdimage/daily-builds/daily/current/i386/iso-cd/debian-testing-i386-netinst.iso
http://cdimage.debian.org/cdimage/daily-builds/daily/current/amd64/iso-cd/debian-testing-amd64-netinst.iso
http://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-cd/debian-testing-amd64-CD-1.iso
http://cdimage.debian.org/cdimage/weekly-builds/i386/iso-cd/debian-testing-i386-CD-1.iso
http://cdimage.debian.org/cdimage/weekly-builds/amd64/iso-dvd/debian-testing-amd64-DVD-1.iso
http://cdimage.debian.org/cdimage/weekly-builds/i386/iso-dvd/debian-testing-i386-DVD-1.iso
)
NOW=$(date +%s)
for i in ${DEBIAN_ISO_URL[*]}; do
old_iso=false
ISO_FILE=$(basename $i)
if [ -f $ISO_FILE ]; then
ISO_TMSTAMP=$(date -r $ISO_FILE +%s)
if [ $(echo $NOW-$ISO_TMSTAMP | bc) -gt 604800 ]; then
rm ./$ISO_FILE
old_iso=true
fi
else
old_iso=true
fi
if $old_iso; then
wget -c $i
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment