Created
August 8, 2024 06:20
-
-
Save scaramangado/7e21e2d5c77705602bd1e27e241e6b82 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env bash | |
| [[ $# != 2 ]] && exit -1 | |
| dvd_drive=$1 | |
| destination=$2 | |
| info=$(isoinfo -d -i /dev/sr0) | |
| block_size=$(grep -oP '(?<=Logical block size is: )\d+' <<< "$info") | |
| volume_size=$(grep -oP '(?<=Volume size is: )\d+' <<< "$info") | |
| total_bytes=$((block_size * volume_size)) | |
| echo "Block size: $block_size" | |
| echo "Volume size: $volume_size" | |
| echo "Total bytes: $total_bytes" | |
| echo "Ripping..." | |
| dd if="$1" bs="$block_size" count="$volume_size" | pv -s "$total_bytes" | dd of="$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment