Created
August 24, 2012 11:18
-
-
Save tskrynnyk/3449329 to your computer and use it in GitHub Desktop.
Debian ISO weekly builds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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