source: gutenbach-remctl/cd-cddb-get @ 53936a5

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

Created a package around the remctl scripts to make
installation easy. Package installs and runs cleanly
on lbsg, but has not been tested on zsr yet.

  • Property mode set to 100755
File size: 697 bytes
Line 
1#!/bin/sh
2PATH="$(dirname $0):$PATH"
3
4CDDBURL="http://freedb.freedb.org/~cddb/cddb.cgi"
5MYUSER="gutenbach"
6MYHOST=`hostname`".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/gutenbach
16
17CACHEFILE="/var/cache/gutenbach/$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.