debianmacno-cupsnodebathenaweb
Last change
on this file since 9f0c46e was
737d88b,
checked in by Jessica B. Hamrick <jhamrick@…>, 14 years ago
|
Add the directory where the source is to the path for all scripts.
|
-
Property mode set to
100755
|
File size:
684 bytes
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | PATH="$(dirname $0):$PATH" |
---|
3 | |
---|
4 | CDDBURL="http://freedb.freedb.org/~cddb/cddb.cgi" |
---|
5 | MYUSER="sipbmp3" |
---|
6 | MYHOST="zsr.mit.edu" |
---|
7 | |
---|
8 | DISCID=$(cd-discid /dev/cdrom 2>/dev/null) || exit 1 |
---|
9 | |
---|
10 | set -- $DISCID |
---|
11 | |
---|
12 | ID="$1" |
---|
13 | TRACKS="$2" |
---|
14 | |
---|
15 | mkdir -p /var/cache/sipbmp3 |
---|
16 | |
---|
17 | CACHEFILE="/var/cache/sipbmp3/$ID" |
---|
18 | |
---|
19 | if [ ! -e "$CACHEFILE" ]; then |
---|
20 | |
---|
21 | CD=$(cddb-tool query "$CDDBURL" 3 "$MYUSER" "$MYHOST" $DISCID) \ |
---|
22 | || exit 2; |
---|
23 | |
---|
24 | file=$(tempfile) |
---|
25 | |
---|
26 | cddb-tool read "$CDDBURL" 3 "$MYUSER" "$MYHOST" \ |
---|
27 | $(echo "$CD" | head -1 | awk '{print $2 " " $3}') > "$file" \ |
---|
28 | || exit 3; |
---|
29 | |
---|
30 | echo "TRACKS=$TRACKS" > "$CACHEFILE" |
---|
31 | cddb-tool parse "$file" >> "$CACHEFILE" |
---|
32 | |
---|
33 | rm "$file" |
---|
34 | fi |
---|
35 | |
---|
36 | echo "$CACHEFILE" |
---|
37 | exit 0; |
---|
Note: See
TracBrowser
for help on using the repository browser.