Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.86 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Thank you for using ** HEAT  **
  4.  
  5. # This is the Glenn Whittington and Lakota Morris project (2010)
  6.  
  7. # This program is designed to (clone copy) karaoke/cdg disk
  8. # and pull cddb data and save it as a text file.
  9.  
  10. # This program requires cdgtools 0.3.2
  11.  
  12. if ! which cdgtools > /dev/null; then
  13. echo “Please install cdgtools or make sure it is in your path”
  14. exit
  15. fi
  16.  
  17. yn() {
  18. printf " Reply [y/n]: "
  19. read yn
  20. [[ "$yn" != y ]] && [[ "$yn" != n ]] && yn
  21. }
  22.  
  23. # This software comes with no waranty, use at your own risk.
  24. # -----------------------------------------
  25.  
  26. # Lakota - need to change to a temp/local file
  27. #mkdir -p /tmp/heat
  28. mkdir -p ./heat
  29. cd ./heat
  30.  
  31. # Lakota - Insert new cd/ make sure you have a new cd in your CD ROM
  32. echo "Make sure you have a CD in the drive."
  33.  
  34. # -----------------------------------------
  35.  
  36. # using cdrdao to read cd and pull cddb data and write BIN & TOC & TEXT files
  37.  
  38. cdrdao read-cd --driver generic-mmc-raw --device /dev/sr0 --read-subchan rw_raw --with-cddb mycd.toc | cat > mycd.txt
  39.  
  40. eject
  41.  
  42. # -----------------------------------------
  43.  
  44. # using cdrdao to show how much space you need on your blank cd
  45.  
  46. cdrdao toc-info mycd.toc
  47.  
  48. # -----------------------------------------
  49.  
  50. # Lakota - show that cddb data has been writen to file as text and ask if want to copy cd/ end
  51.  
  52. echo "cddb data has been written to file."
  53.  
  54. echo "Would you like to copy the CD? "
  55. yn
  56.  
  57. [[ "$yn = y" ]] && cdrdao write --device /dev/sr0 --speed 8 mycd.toc
  58.  
  59.  
  60.  
  61. # -----------------------------------------
  62.  
  63. # Lakota - ask if want to rip TOC & BIN to MP3 & CDG files
  64.  
  65. echo "Want to rip TOC & BIN to MP3 & CDG files? "
  66. [[ "$yn = y" ]] && cdgrip mycd.toc
  67.  
  68. echo "Want to delete TOC file?"
  69. [[ "$yn = y" ]] && rm -iv mycd.toc
  70.  
  71. echo "Want to delete BIN file?"
  72. [[ "$yn = y" ]] && rm -iv data.bin
  73.  
  74. #------------------ EOF -------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement