Skip to content

Instantly share code, notes, and snippets.

@Tatsh
Last active December 16, 2016 14:59
Show Gist options
  • Save Tatsh/bc3947f83b2e4e00d41d to your computer and use it in GitHub Desktop.
Save Tatsh/bc3947f83b2e4e00d41d to your computer and use it in GitHub Desktop.
Burn a CDI (not by me)
#!/usr/bin/env bash
set -o errexit
cdi_img="$1"
device="${2:-/dev/sr0}"
cdirip "$cdi_img" -cdrecord
i=1
while true; do
n=$(printf '%02u' "$i")
iso="tdata${n}.iso"
wav="taudio${n}.wav"
if [ -f "$wav" ]; then
cdrecord "dev=${device}" speed=4 -multi -audio "$wav"
rm "$wav"
elif [ -f "$iso" ]; then
cdrecord "dev=${device}" speed=4 -multi -xa "$iso"
rm "$iso"
else
break
fi
((i++))
done
eject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment