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