source: gutenbach/debian/lib/cd-play @ 737d88b

debianmacno-cupsnodebathenaweb
Last change on this file since 737d88b 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: 507 bytes
Line 
1#!/bin/sh
2PATH="$(dirname $0):$PATH"
3
4CDDB=
5
6CACHE=$(cd-cddb-get)
7
8if [ "$?" = 0 ]; then
9    CDDB=1
10fi
11
12. "$CACHE"
13
14play_one () {
15    T=$1
16    if [ -n "$CDDB" ]; then
17        DESC=" - "$(eval 'echo $TRACK'$T)
18    fi
19
20    echo "cdda://$(($T - 1))" | mit-lpr -Psipbmp3@localhost -J "Track $T$DESC";
21    echo "Queued Track $T$DESC";
22}
23
24TOPLAY="$2"
25
26if [ -z "$TOPLAY" -o "$TOPLAY" = "all" ]; then
27    for i in $(seq 1 "$TRACKS"); do
28        play_one $i
29    done
30else
31    shift;
32    for i in "$@"; do
33        play_one $i
34    done
35fi
Note: See TracBrowser for help on using the repository browser.