-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcdwrite
More file actions
executable file
·153 lines (135 loc) · 4.14 KB
/
Copy pathcdwrite
File metadata and controls
executable file
·153 lines (135 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/bash
#
# mp3lib v1.0
# cdwrite
# By Nick Sagona
# Rip an exact copy of an audio or enhanced CD.
#
# Syntax: cdwrite -m filename
# Help: cdwrite -h
#
# Dependencies: cdrdao, cdrecord, cdrip
# Display help if flagged
help="\n
mp3lib v1.0\n
cdwrite\n
By Nick Sagona\n
Write an exact copy of an audio or enhanced CD.\n
\n
Dependencies: cdrdao, cdrecord, cdrip\n
\n
Test system for necessary software:\n
------------------------------------------------------------------------------------------------\n
cdwrite -t\n
\n
Write (burn) an audio CD:\n
------------------------------------------------------------------------------------------------\n
cdwrite -f filename\n
e.g. cdwrite \"1969 - Led Zeppelin I\"\n
\n
Write (burn) an enhanced CD:\n
------------------------------------------------------------------------------------------------\n
cdwrite -m -f filename\n
cdwrite -m -f \"1969 - Led Zeppelin I\"\n
\n
Use a different CD device:\n
------------------------------------------------------------------------------------------------\n
cdwrite -d /dev/newdev -f filename\n
cdwrite -d /dev/cdrom1 -f \"1969 - Led Zeppelin I\"\n
\n
Notes:\n
------------------------------------------------------------------------------------------------\n
cdwrite will use the BIN, TOC and ISO files created by cdrip to burn an exact copy of an audio\n
or enhanced CD. Therefore, the files must follow the same naming convention set forth by cdrip,\n
for example:\n
\n
1969 - Led Zeppelin I.bin (raw audio)\n
1969 - Led Zeppelin I.toc (table of contents)\n
1969 - Led Zeppelin I.iso (iso data file)\n
"
# Check for proper arguments
device="/dev/cdrom"
filename=
multi=
# Set proper extensions
while getopts :htf:d:m opt
do
case $opt in
h) echo -e $help
exit 0
;;
t) echo -e "\nTesting System...\n"
if [ $(which cdrdao | wc -l) -ne 0 ]; then
echo "cdrdao found!"
cdrdao=true
else
echo "cdrdao not found!"
fi
if [ $(which toc2cue | wc -l) -ne 0 ]; then
echo "toc2cue found!"
toc2cue=true
else
echo "toc2cue not found!"
fi
if [ $(which mkisofs | wc -l) -ne 0 ]; then
echo "mkisofs found!"
mkisofs=true
else
echo "mkisofs not found!"
fi
if [ $(which cdrecord | wc -l) -ne 0 ]; then
echo "cdrecord found!"
cdrecord=true
else
echo "cdrecord not found!"
fi
if [ $(which bchunk | wc -l) -ne 0 ]; then
echo "bchunk found!"
bchunk=true
else
echo "bchunk not found!"
fi
if [ $(which lame | wc -l) -ne 0 ]; then
echo "lame found!"
lame=true
else
echo "lame not found!"
fi
if [ $(which eyeD3 | wc -l) -ne 0 ]; then
echo "eyeD3 found!"
eyeD3=true
else
echo "eyeD3 not found!"
fi
if [ "${cdrdao}" == "true" ] && [ "${toc2cue}" == "true" ] && [ "${mkisofs}" == "true" ] && [ "${cdrecord}" == "true" ] && [ "${bchunk}" == "true" ] && [ "${lame}" == "true" ] && [ "${eyeD3}" == "true" ]; then
echo -e "\nAll the necessary software is installed.\n"
else
echo -e "\nNot all of the software required by mp3lib is installed.\n"
echo -e "Please check the list above and install the software needed.\n"
fi
exit 0
;;
d) device=$OPTARG
;;
m) multi="--multi "
;;
f) filename=$OPTARG
;;
*) break;;
esac
done
if [ "$filename" = "" ]
then
echo "You must enter a filename. -h for help."
exit 0
fi
# Set proper filenames
filenametoc=$filename".toc"
filenameiso=$filename".iso"
# Burn audio session to disc
cdrdao write $multi--device $device "$filenametoc"
# Burn data session to disc, if applicable
if [ "$multi" == "--multi " ]
then
cdrecord -v dev=$device "$filenameiso"
fi