Skip to content

Instantly share code, notes, and snippets.

@erodozer
Created June 19, 2016 02:44
Show Gist options
  • Select an option

  • Save erodozer/9915fcf6b7a08248d96ade22ffb24e33 to your computer and use it in GitHub Desktop.

Select an option

Save erodozer/9915fcf6b7a08248d96ade22ffb24e33 to your computer and use it in GitHub Desktop.
Stupid simple bash script for properly ripping PS2 dvds and naming them by their SLUS
#!/bin/sh
device='/dev/sr0'
mount=$(mount | grep $device | cut -d " " -f 3)
DVD_NAME=$(find $mount -name "SLUS_*" | grep -o '[^/]*$')
blockcount=$(isoinfo -d -i $device | grep "^Volume size is:" | cut -d " " -f 4)
blocksize=$(isoinfo -d -i $device | grep "^Logical block size is:" | cut -d " " -f 5)
dd if=$device bs=$blocksize count=$blockcount of=$DVD_NAME.iso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment