source: remctl/lib/gutenbach/cd-play @ 9c0279e

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

Create Makefiles and fix install scripts.

  • 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.