source: gutenbach/debian/lib/cd-cddb-get @ 28836c2

debianmacno-cupsnodebathenaweb
Last change on this file since 28836c2 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
2PATH="$(dirname $0):$PATH"
3
4CDDBURL="http://freedb.freedb.org/~cddb/cddb.cgi"
5MYUSER="sipbmp3"
6MYHOST="zsr.mit.edu"
7
8DISCID=$(cd-discid /dev/cdrom 2>/dev/null) || exit 1
9
10set -- $DISCID
11
12ID="$1"
13TRACKS="$2"
14
15mkdir -p /var/cache/sipbmp3
16
17CACHEFILE="/var/cache/sipbmp3/$ID"
18
19if [ ! -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"
34fi
35
36echo "$CACHEFILE"
37exit 0;
Note: See TracBrowser for help on using the repository browser.