aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Dulieu <pascal@dulieu.uk>2019-03-07 16:38:25 +0000
committerPascal Dulieu <pascal@dulieu.uk>2019-03-07 16:38:25 +0000
commit8dc303ac8ae7ebb45f38e000bb413d6f758adaad (patch)
tree8e02110fa1f0c299fbaaa2f2539a86ba1a3df7ad
parent1f3a06c7d1f489e0fc9cac871f884e98f103a260 (diff)
Code cleanupHEADmaster
Code cleanup thanks to Dimtree
-rw-r--r--ripdisc39
1 files changed, 16 insertions, 23 deletions
diff --git a/ripdisc b/ripdisc
index 4ca28e9..1741c20 100644
--- a/ripdisc
+++ b/ripdisc
@@ -1,27 +1,20 @@
#!/bin/bash
-echo "Press Ctrl+C to stop the script"
-eject
-while :
-do
- echo "Please insert disc"
- disc=2
-
- while [[ $disc != 0 ]]
- do
- sudo blkid /dev/sr0 >> /dev/null
- disc=$?
- sleep 5
- done
-
- name=$(sudo blkid /dev/sr0 | cut -d= -f3 | cut -d'"' -f2)
- output=$(echo $name | sed -e 's/ /_/g')
- echo "Disc Found: $name"
- echo "Outputting to: $output.iso"
- # Set save path here
- dd if=/dev/sr0 | pv | dd of=~/ISOs/$output.iso
+SAVE_PATH="$HOME/ISOs/"
- echo "Finished! Insert your next disc"
- eject
- sleep 10
+echo "Press Ctrl+C to stop the script"
+eject
+while true; do
+ echo "Please insert disc"
+ until sudo blkid /dev/sr0 >/dev/null; do
+ sleep 5
+ done
+ name=$(sudo blkid /dev/sr0 | cut -d= -f3 | cut -d'"' -f2)
+ output=$(echo $name | sed -e 's/ /_/g')
+ echo "Disc Found: $name"
+ echo "Outputting to: $output.iso"
+ dd if=/dev/sr0 | pv | dd of="${SAVE_PATH}/${output}.iso"
+ echo "Finished! Insert your next disc"
+ eject
+ sleep 10
done