source: gutenbach/debian/lib/cd-cddb-get @ 83733c9

debianmacno-cupsnodebathenaweb
Last change on this file since 83733c9 was 83733c9, checked in by Jessica B. Hamrick <jhamrick@…>, 14 years ago

Add all of the other stuff.o
Signed-off-by: root <root@…>

  • Property mode set to 100755
File size: 657 bytes
Line 
1#!/bin/sh
2
3CDDBURL="http://freedb.freedb.org/~cddb/cddb.cgi"
4MYUSER="sipbmp3"
5MYHOST="zsr.mit.edu"
6
7DISCID=$(cd-discid /dev/cdrom 2>/dev/null) || exit 1
8
9set -- $DISCID
10
11ID="$1"
12TRACKS="$2"
13
14mkdir -p /var/cache/sipbmp3
15
16CACHEFILE="/var/cache/sipbmp3/$ID"
17
18if [ ! -e "$CACHEFILE" ]; then
19
20    CD=$(cddb-tool query "$CDDBURL" 3 "$MYUSER" "$MYHOST" $DISCID) \
21        || exit 2;
22
23    file=$(tempfile)
24
25    cddb-tool read "$CDDBURL" 3 "$MYUSER" "$MYHOST" \
26        $(echo "$CD" | head -1 | awk '{print $2 " " $3}') > "$file"  \
27        || exit 3;
28
29    echo "TRACKS=$TRACKS"   >  "$CACHEFILE"
30    cddb-tool parse "$file" >> "$CACHEFILE"
31
32    rm "$file"
33fi
34
35echo "$CACHEFILE"
36exit 0;
Note: See TracBrowser for help on using the repository browser.