Skip to content

Instantly share code, notes, and snippets.

@gunyarakun
Created October 23, 2014 01:33
Show Gist options
  • Save gunyarakun/b893e5b0089deb054aed to your computer and use it in GitHub Desktop.
Save gunyarakun/b893e5b0089deb054aed to your computer and use it in GitHub Desktop.
Make DVD ISO image sequentially
#!/usr/bin/env ruby
require 'date'
HDD_PATH = '/Volumes/HFS_disks_from_japan/mushu_avs'
while true do
d = DateTime.now
status = `drutil status`
if status =~ /^\s+Type: [-A-Z]+\s+Name: (.+)$/
device = $1
mount = `mount`
if mount =~ /^#{device} on (.+) \(.+\)$/
dvd_path = $1
output_path = HDD_PATH + '/' + d.strftime('%Y%m%d%H%M%S.iso')
puts "From #{dvd_path} To #{output_path}"
system "hdiutil makehybrid -iso -joliet -o '#{output_path}' '#{dvd_path}' && drutil tray eject"
end_message = 'end end end'
system "say #{end_message}"
end
end
sleep 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment