Skip to content

Instantly share code, notes, and snippets.

@mstrauss
Created January 19, 2011 11:36
Show Gist options
  • Save mstrauss/786044 to your computer and use it in GitHub Desktop.
Save mstrauss/786044 to your computer and use it in GitHub Desktop.
a script for updating debian boot images
#!/usr/bin/env ruby
require 'fileutils'
include FileUtils
dists = [ 'lenny', 'squeeze' ]
basenames = [ 'i386', 'amd64' ]
files = [ 'linux', 'initrd.gz' ]
progdir = File.expand_path(File.dirname(__FILE__))
dists.each do |dist|
basenames.each do |base|
mkdir_p "#{progdir}/#{dist}/#{base}"
files.each do |file|
url = "http://ftp.de.debian.org/debian/dists/#{dist}/main/installer-#{bas\
e}/current/images/netboot/debian-installer/#{base}/#{file}"
destination = "#{progdir}/#{dist}/#{base}/#{file}"
unless system("curl --fail -s -S #{url} > #{destination}")
puts "Download of #{url} failed."
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment