Created
October 23, 2014 01:33
-
-
Save gunyarakun/b893e5b0089deb054aed to your computer and use it in GitHub Desktop.
Make DVD ISO image sequentially
This file contains 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
#!/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