Index: itignore
===================================================================
--- .gitignore	(revision 3a900ef83e815ab88516a271a9bbdc2348de0d74)
+++ 	(revision )
@@ -1,6 +1,0 @@
-*~
-vm*
-ksplice*
-voldaemon
-log
-printcap
Index: debian/athena-counterlog
===================================================================
--- debian/athena-counterlog	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/athena-counterlog	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# We want a unique ID for each machine, ideally surviving a reinstall.
+# Produce the ID using the hardware addresses of the ethernet devices,
+# and save it to a file so that it at least survives the duration of
+# this install.
+idfile=/var/lib/debathena-counterlog/id
+if [ -r $idfile ]; then
+  id=$(cat $idfile)
+else
+  id=$(ifconfig -a | sed -nre 's/.*HWaddr ([^ ]+).*/\1/p' | sort -u \
+       | md5sum | awk '{print $1}')
+  echo "$id" > $idfile
+fi
+
+version=$(machtype -L)
+loghost=wslogger.mit.edu
+host=$(hostname --fqdn)
+mtype=$(machtype)
+ctype=$(machtype -c)
+
+# Traditionally, we do counter logging via syslog.  (We could do it
+# via HTTP post or something else instead, if we wanted.)  We can't
+# rely on central syslogging being configured because that's a
+# cluster-only package.  Fortunately, the syslog protocol is dead
+# simple, so just fake a packet to the log host.
+msg="<13>root: counterlog: $host $mtype $ctype $version $id cron"
+printf "%s" "$msg" | nc -q0 -u $loghost syslog
Index: debian/changelog
===================================================================
--- debian/changelog	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/changelog	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,5 @@
+debathena-lprmp3 (1.0) unstable; urgency=low
+
+  * Initial release.
+
+ -- Jessica Hamrick <jhamrick@mit.edu>  Tue, 08 Sep 2009 18:38:12 -0400
Index: debian/compat
===================================================================
--- debian/compat	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/compat	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,1 @@
+5
Index: debian/control.in
===================================================================
--- debian/control.in	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/control.in	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,14 @@
+Source: sipbmp3
+Section: debathena/sound
+Priority: extra
+Maintainer: Jessica Hamrick <jhamrick@mit.edu>
+Build-Depends: @cdbs@
+Standards-Version: 3.8.3
+
+Package: sipbmp3
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}, mplayer, libimage-exiftool-perl, lprng, sysv-rc
+Recommends: debathena-zephyr-config libzephyr3-krb zephyr-clients
+Description: Server for playing music files from a remote machine.
+ Allows remote machines to play music files on this machine
+ by "printing" them with debathena-lprng.
Index: debian/root/cd-cddb
===================================================================
--- debian/root/cd-cddb	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/cd-cddb	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,20 @@
+#!/bin/sh
+PATH="$(dirname $0):$PATH"
+
+die () {
+    echo "$@";
+    exit 1;
+}
+
+CACHE=$(cd-cddb-get) || die "Unable to fetch CDDB information."
+
+. "$CACHE"
+
+echo "Artist: $DARTIST";
+echo "Album: $DALBUM";
+echo "Tracks: $TRACKS";
+
+for i in $(seq 1 $TRACKS); do
+    echo -n "Track $i: "
+    eval 'echo $TRACK'$i
+done
Index: debian/root/cd-cddb-get
===================================================================
--- debian/root/cd-cddb-get	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/cd-cddb-get	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,37 @@
+#!/bin/sh
+PATH="$(dirname $0):$PATH"
+
+CDDBURL="http://freedb.freedb.org/~cddb/cddb.cgi"
+MYUSER="sipbmp3"
+MYHOST="zsr.mit.edu"
+
+DISCID=$(cd-discid /dev/cdrom 2>/dev/null) || exit 1
+
+set -- $DISCID
+
+ID="$1"
+TRACKS="$2"
+
+mkdir -p /var/cache/sipbmp3
+
+CACHEFILE="/var/cache/sipbmp3/$ID"
+
+if [ ! -e "$CACHEFILE" ]; then
+
+    CD=$(cddb-tool query "$CDDBURL" 3 "$MYUSER" "$MYHOST" $DISCID) \
+	|| exit 2;
+
+    file=$(tempfile)
+
+    cddb-tool read "$CDDBURL" 3 "$MYUSER" "$MYHOST" \
+	$(echo "$CD" | head -1 | awk '{print $2 " " $3}') > "$file"  \
+	|| exit 3;
+
+    echo "TRACKS=$TRACKS"   >  "$CACHEFILE"
+    cddb-tool parse "$file" >> "$CACHEFILE"
+
+    rm "$file"
+fi
+
+echo "$CACHEFILE"
+exit 0;
Index: debian/root/cd-play
===================================================================
--- debian/root/cd-play	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/cd-play	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,35 @@
+#!/bin/sh
+PATH="$(dirname $0):$PATH"
+
+CDDB=
+
+CACHE=$(cd-cddb-get)
+
+if [ "$?" = 0 ]; then
+    CDDB=1
+fi
+
+. "$CACHE"
+
+play_one () {
+    T=$1
+    if [ -n "$CDDB" ]; then
+	DESC=" - "$(eval 'echo $TRACK'$T)
+    fi
+
+    echo "cdda://$(($T - 1))" | mit-lpr -Psipbmp3@localhost -J "Track $T$DESC";
+    echo "Queued Track $T$DESC";
+}
+
+TOPLAY="$2"
+
+if [ -z "$TOPLAY" -o "$TOPLAY" = "all" ]; then
+    for i in $(seq 1 "$TRACKS"); do
+	play_one $i
+    done
+else
+    shift;
+    for i in "$@"; do
+	play_one $i
+    done
+fi
Index: debian/root/status-clear
===================================================================
--- debian/root/status-clear	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/status-clear	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,3 @@
+#!/bin/sh
+PATH="$(dirname $0):$PATH"
+> /var/run/sipbmp3/status
Index: debian/root/status-get
===================================================================
--- debian/root/status-get	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/status-get	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,3 @@
+#!/bin/sh
+PATH="$(dirname $0):$PATH"
+cat /var/run/sipbmp3/status
Index: debian/root/voldaemon.c
===================================================================
--- debian/root/voldaemon.c	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/voldaemon.c	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,319 @@
+/*
+ * $Id: voldaemon.c,v 1.1 2008-09-27 08:49:10 root Exp $
+ * $Source: /tmp/tmp.UFBNno9997/RCS/voldaemon.c,v $
+ */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <sys/ioctl.h>
+#include <sys/time.h>
+#include <errno.h>
+#include <assert.h>
+#include <netinet/in.h>
+
+
+#define LISTEN_PORT 8930
+#define MULTI_PORT 8931
+#define MULTI_ADDR "224.0.1.20"
+
+/* Block queries from off this subnet net 18.*/
+#define OUR_SUBNET      187
+
+typedef struct volmessage{
+  char A;
+  char request;
+  char value;
+  unsigned char ip_3;
+  unsigned char ip_2;
+  unsigned char ip_1;
+  unsigned char ip_0;
+  char ZE;
+} volmessage;
+
+#define MESSAGE_SIZE (sizeof(volmessage))
+
+/* The client makes requests using the following packets.  Responses
+   to queries and status reports from the server follow the same
+   pattern
+
+  Request/Response
+
+  'AVxiiiiZ'     Volume
+  'AMxiiiiZ'     Mute
+  'AQQiiiiZ'     Query 
+
+  Response Only
+  'AVeiiiiE'     Volume Set Error 
+  'AMeiiiiE'     Mute Set Error 
+  'AEeiiiiE'     Unknown error 
+
+   e=1  Permission denied (invalid IP)
+   e=2  Invalid request (Bad Packet)
+   
+*/
+
+void message(char *m){
+  write(STDERR_FILENO,m,strlen(m));
+}
+
+void abortm(char *m){
+  message(m);
+  message("Errno = ");
+  message(strerror(errno));
+  message("\n");
+  exit(1);
+}
+
+struct in_addr multiaddr={0};
+
+int multicast(volmessage *m){
+  static int sockfd=-1;
+  static struct sockaddr_in dest;
+  int destlen=sizeof(dest);
+
+  if(sockfd==-1)
+    if((sockfd=socket(AF_INET,SOCK_DGRAM,0))<0)
+      abortm("Could not open multicast socket\n");
+
+  if(multiaddr.s_addr==0)
+    multiaddr.s_addr = inet_addr(MULTI_ADDR);
+      /*inet_aton(MULTI_ADDR,&multiaddr);*/
+
+  memset(&dest,0,sizeof(dest));
+  dest.sin_family=AF_INET;
+  dest.sin_addr.s_addr=multiaddr.s_addr;
+  dest.sin_port=htons(MULTI_PORT);
+
+  if(sendto(sockfd,m,MESSAGE_SIZE,0,(struct sockaddr *)&dest,destlen)<0){
+    message("Multicast send error\n");
+    return(1);
+  }
+  return(0);
+}
+
+int sockfd=-1,volfd;
+static struct sockaddr_in me,you;
+static int youlen=sizeof(you);
+struct in_addr multiaddr;
+
+int opensock(){
+  if((sockfd=socket(AF_INET,SOCK_DGRAM,0))<0)
+    abortm("Could not open listen socket\n");
+
+  memset(&me,0,sizeof(me));
+  me.sin_family=AF_INET;
+  me.sin_addr.s_addr=htonl(INADDR_ANY);
+  me.sin_port=htons(LISTEN_PORT);
+
+  if(bind(sockfd,(struct sockaddr *)&me,sizeof(me))<0)
+    abortm("Could not bind to listen port\n");
+
+  listen(sockfd,5);
+  return(sockfd);
+}
+
+/*  -1 blocks
+    0  nonblocking
+    +n timeout 
+*/
+
+int
+fetch (int usec, volmessage *m) {
+  fd_set fdset;
+  int retval;
+  struct timeval tv;
+  if(sockfd==-1)
+    opensock();
+
+  FD_ZERO(&fdset);
+  FD_SET(sockfd, &fdset);
+
+  tv.tv_sec = 0;
+  tv.tv_usec = usec;
+  retval = select(sockfd+1,
+		  &fdset, NULL, NULL,
+		  ((usec == -1) ? NULL : &tv));
+  if (retval == 1) {
+    /* Select got us a single descriptor to play with, as we
+     * expected. Pull a message from it. */
+    int youlen = sizeof(you);
+    retval = recvfrom(sockfd,
+		      m, MESSAGE_SIZE,
+		      0,
+		      (struct sockaddr *)&you, &youlen);
+    if(retval < MESSAGE_SIZE || m->A != 'A' || m->ZE != 'Z') {
+      message("Packet receive error\n");
+      return(0);
+    } else {
+      return(1);
+    }
+  } else {
+    if (retval == 0) {
+      /* This means the timeout finished. */
+    } else if (retval == -1) {
+      fprintf(stderr, "Select error. errno = %d (%s).\n",
+	      errno, strerror(errno));
+    } else {
+      fprintf(stderr, "Select returned unexpected value %d.\n", retval);
+    }
+    /* Whatever error we get, we just return 0. */
+    return(0);
+  }
+}
+
+
+int
+reply (volmessage *m) {
+  int retval;
+  assert(sockfd != -1);
+  
+  retval = sendto(sockfd,
+		  m, MESSAGE_SIZE,
+		  0,
+		  (struct sockaddr *)&you, youlen);
+  if(retval < 0){
+    message("Reply error\n");
+    return(1);
+  }
+  return(0);
+}
+  
+int vol_iterate(int newval){
+  static int val=0;
+  char command[100];
+  
+
+  if (val==newval)
+    return(0);
+
+  if (val<newval) {
+    val+=8;
+    if(val>newval)
+      val=newval;
+  } else {
+    val-=8;
+    if(val<newval)
+      val=newval;
+  }
+  sprintf(command,"/usr/bin/aumix -v %d",val);
+  fprintf(stderr,"Setting volume to %d\n",val);
+  system(command);
+  return(1);
+}
+
+int main(){
+  unsigned char volume=32,mute=0,ip_3=0,ip_2=0,ip_1=0,ip_0=0;
+  int messagestatus=1,volstatus=1;
+  volmessage m;
+
+  system("/usr/bin/aumix -v 0");
+  system("/usr/bin/aumix -i 100");
+  system("/usr/bin/aumix -l 100");
+
+  message("\nSIPB volume daemon running\n");
+
+  /* We want to process messages quickly, then get to the business of
+     controlling ther hardware when no messages are in the queue. 
+     The select on the message fetch also does our timing for volume
+     iteration */
+
+  while(1){
+    if(messagestatus==1)
+      /* Messages likely pending.  Process quickly */
+      messagestatus=fetch(0,&m);
+    else
+      if(volstatus==1){
+	/* No messages, but volume to be updated */
+	messagestatus=fetch(50,&m);
+	if(messagestatus==0)volstatus=vol_iterate(mute?0:volume);
+      }else{
+	/* Steady state.  Wait (almost) forever until a message */
+	m.ip_0=ip_0;
+	m.ip_1=ip_1;
+	m.ip_2=ip_2;
+	m.ip_3=ip_3;
+	m.A='A';
+	m.request='V';
+	m.value=volume;
+	m.ZE='Z';
+    	multicast(&m);
+	m.A='A';
+	m.request='M';
+	m.value=mute;
+	m.ZE='Z';
+    	multicast(&m);
+	messagestatus=fetch(400000,&m);
+      }
+
+    if(messagestatus){
+      int error=0;
+      m.ip_3=(ntohl(you.sin_addr.s_addr)>>24)&0xff;
+      m.ip_2=(ntohl(you.sin_addr.s_addr)>>16)&0xff;
+      m.ip_1=(ntohl(you.sin_addr.s_addr)>>8)&0xff;
+      m.ip_0=ntohl(you.sin_addr.s_addr)&0xff;
+
+      if(m.ip_3!=18 || m.ip_2!=OUR_SUBNET){
+	error=1;
+      }
+
+      switch(m.request){
+      case 'V':
+	if(error){
+	  m.value=error;
+	  m.ZE='E';
+	  reply(&m);
+	  message("Request from off subnet rejected\n");
+	}else{
+	  ip_0=m.ip_0;
+	  ip_1=m.ip_1;
+	  ip_2=m.ip_2;
+	  ip_3=m.ip_3;
+	  volume=m.value;
+	  reply(&m);
+	  multicast(&m);
+	  volstatus=1;
+	}
+	break;
+      case 'M':
+	if(error){
+	  m.value=error;
+	  m.ZE='E';
+	  reply(&m);	  
+	  message("Request from off subnet rejected\n");
+	}else{
+	  ip_0=m.ip_0;
+	  ip_1=m.ip_1;
+	  ip_2=m.ip_2;
+	  ip_3=m.ip_3;
+	  mute=(m.value?1:0);
+	  m.value=mute;
+	  reply(&m);
+	  multicast(&m);
+	  volstatus=1;
+	}
+	break;
+      case 'Q':
+	m.ip_0=ip_0;
+	m.ip_1=ip_1;
+	m.ip_2=ip_2;
+	m.ip_3=ip_3;
+	m.request='V';
+	m.value=volume;
+	reply(&m);
+	m.request='M';
+	m.value=mute;
+	reply(&m);
+	break;
+      default:
+	reply((volmessage *)"AE20000E");
+	break;
+      }
+    }
+  }
+}
Index: debian/root/volume-down
===================================================================
--- debian/root/volume-down	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/volume-down	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,3 @@
+#!/bin/sh
+PATH="$(dirname $0):$PATH"
+volume-set . $(( $(volume-get .) - 1 ))
Index: debian/root/volume-get
===================================================================
--- debian/root/volume-get	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/volume-get	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,4 @@
+#!/bin/sh
+PATH="$(dirname $0):$PATH"
+amixer get Headphone \
+ | perl -lne 'print $1 if (/Front Left: Playback ([0-9]+)/)'
Index: debian/root/volume-help
===================================================================
--- debian/root/volume-help	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/volume-help	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,15 @@
+#!/bin/bash
+PATH="$(dirname $0):$PATH"
+cat <<EOF
+Usage: remctl zsr.mit.edu <command> <subcommand> [..args..]
+Commands:
+  volume up        - increment volume
+  volume down      - decrement volume
+  volume get       - get volume
+  volume set [vol] - set volume, in range 0..31
+  volume mute      - zero volume
+  volume help,
+   help <anything> - print this help
+
+'v', 'u', 'd' abbreviate 'volume', 'up', 'down' respectively.
+EOF
Index: debian/root/volume-mute
===================================================================
--- debian/root/volume-mute	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/volume-mute	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,3 @@
+#!/bin/sh
+PATH="$(dirname $0):$PATH"
+amixer set Headphone toggle
Index: debian/root/volume-set
===================================================================
--- debian/root/volume-set	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/volume-set	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,4 @@
+#!/bin/sh
+PATH="$(dirname $0):$PATH"
+amixer set Headphone "$2" \
+ | perl -lne 'print $1 if (/Front Left: Playback ([0-9]+)/)'
Index: debian/root/volume-up
===================================================================
--- debian/root/volume-up	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/root/volume-up	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,3 @@
+#!/bin/sh
+PATH="$(dirname $0):$PATH"
+volume-set . $(( $(volume-get .) + 1 ))
Index: debian/rules
===================================================================
--- debian/rules	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/rules	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,6 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+
+binary-fixup/debathena-counterlog::
+	chmod +x $(DEB_DESTDIR)/usr/lib/debathena-counterlog/athena-counterlog
Index: debian/sipbmp3-filter
===================================================================
--- debian/sipbmp3-filter	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/sipbmp3-filter	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,320 @@
+#!/usr/athena/bin/perl
+# Play the data on STDIN as an audio file
+#
+# $Id: sipbmp3-filter,v 1.26 2009/02/20 00:27:17 geofft Exp root $
+# $Source: /usr/local/bin/RCS/sipbmp3-filter,v $
+#
+# TODO
+# ----
+# Make this structured code. It's a mess.
+# Repeat what we just played for EXT files too
+# Support HTTP Auth on ogg streams
+# License, cleanup and package
+#
+# Jered Floyd <jered@mit.edu> takes very little credit for this code
+# apparently neither does Quentin Smith <quentin@mit.edu>
+
+use Image::ExifTool qw(ImageInfo);
+use File::Spec::Functions;
+use File::Temp qw{tempdir};
+use File::Basename qw(basename);
+use LWP::UserAgent;
+use Data::Dumper;
+use IPC::Open2;
+
+my $zephyr_class = "sipb-auto";
+my $host = "zsr";
+my $queue = "sipbmp3";
+
+# Configuration
+my $config_file = "/etc/sipbmp3-filter-config.pl";
+if (-r $config_file) {
+    # Inline the configuration file
+    local $/;
+    my $fh;
+    open $fh, $config_file;
+    eval <$fh>;
+}
+
+my $ua = new LWP::UserAgent;
+
+close(STDERR);
+open(STDERR, ">>", "/tmp/sipbmp3.log") or warn "Couldn't open log: $!";
+
+$ENV{"TERM"}="vt100";
+
+print STDERR "STDERR FROM SPOOL FILTER\n";
+
+# set real uid to be effective uid
+$< = $>;
+
+# Select the correct output device and set the volume
+#system("amixer -q set Headphone 100\% unmute");
+
+# The command line we get from lpd is (no spaces between options and args):
+#  -C lpr -C class
+#  -A LPRng internal identifier
+#  -H originating host
+#  -J lpr -J jobname (default: list of files)
+#  -L lpr -U username
+#  -P logname
+#  -Q queuename (lpr -Q)
+#  -Z random user-specified options
+#  -a printcap af (accounting file name)
+#  -d printcap sd entry (spool dir)
+#  -e print job data file name (currently being processed)
+#  -h print job originiating host (same as -H)
+#  -j job number in spool queue
+#  -k print job control file name
+#  -l printcap pl (page length)
+#  -n user name (same as -L)
+#  -s printcap sf (status file)
+#  -w printcap pw (page width)
+#  -x printcap px (page x dimension)
+#  -y printcap py (page y dimension)
+# accounting file name
+
+printf(STDERR "Got \@ARGV: %s\n", Dumper(\@ARGV));
+
+my %opts;
+
+my @NEWARGV;
+
+foreach my $arg (@ARGV) {
+  if ($arg =~ m/^-([a-zA-Z])(.*)$/) {
+    $opts{$1} = $2;
+  } else {
+    push @NEWARGV, @ARGV;
+  }
+}
+
+@ARGV = @NEWARGV;
+
+printf(STDERR Dumper(\%opts));
+
+# Status messages at start of playback
+open(ZEPHYR, '|/usr/athena/bin/zwrite -d -n -c '. $zephyr_class .' -i ' .
+  $queue.'@'.$host.' -s "SIPB LPR music spooler"');
+
+# For the Now Playing remctl command
+open(STATUS, '>', '/var/run/sipbmp3/status') or die("Can't open status file /var/run/sipbmp3/status");
+
+print(ZEPHYR "$opts{'n'}\@$opts{'H'} is playing:\n");
+print(STATUS "User: $opts{'n'}\@$opts{'H'}\n");
+
+# SIGHUP handler
+sub clear_status {
+    # Possible race condition if the previous status is still going
+    open(STA, '>', '/var/run/sipbmp3/status');
+    close(STA);
+    open(ZEPH, '|/usr/athena/bin/zwrite -d -n -c '. $zephyr_class .' -i '.
+        $queue.'@'.$host.' -s "SIPB LPR music spooler"');
+    print(ZEPH "Playback aborted.\n");
+    close(ZEPH);
+    die;
+}
+$SIG{HUP} = \&clear_status;
+
+# So, the file we're currently processing is "-d/-e".
+
+# Read the metadata information from the file.
+my ($filepath) = catfile($opts{'d'}, $opts{'e'});
+my ($fileinfo) = ImageInfo($filepath);
+my ($magic) = $fileinfo->{FileType};
+
+if ($magic) {
+    printf(ZEPHYR "%s file %s\n", $magic, $opts{'J'});
+    printf(STATUS "Filetype: %s\n", $magic);
+    printf(STATUS "Filename: %s\n", $opts{'J'});
+    if (exists $fileinfo->{'Title'}) {
+        printf(ZEPHYR "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'};
+        printf(STATUS "Title: %s\n", $fileinfo->{'Title'});
+    }
+    foreach my $key (qw/Artist Album AlbumArtist/) {
+        if (exists $fileinfo->{$key}) {
+            printf(ZEPHYR "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key};
+            printf(STATUS "%s: %s\n", $key, $fileinfo->{$key});
+        }
+    }
+    my $tempdir = tempdir();
+    $opts{'J'} =~ s/_mp3/.mp3/; #awful hack -- geofft
+    my $newpath = $tempdir . '/' . basename($opts{'J'});
+    symlink($filepath, $newpath);
+    $filepath = $newpath;
+}
+elsif ($opts{'C'} eq 'Z') {
+    $filepath = resolve_external_reference($filepath, \%opts);
+    if ($filepath =~ m|http://www\.youtube\.com/watch\?v=|) {
+        $pid = open2($out, $in, qw{youtube-dl -g2}, $filepath);
+        $title = <$out>;
+        print ZEPHYR "YouTube video $filepath\n$title";
+        print STATUS "YouTube video $filepath\n$title";
+        $filepath = <$out>;
+        chomp $filepath;
+        waitpid $pid, 0;
+    } else {
+        print STDERR "Resolved external reference to $filepath\n";
+        printf(ZEPHYR "%s\n", $filepath);
+        printf(STATUS "External: %s\n", $filepath);
+    }
+}
+elsif (-T $filepath) {
+    split_playlist($filepath, \%opts);
+    close(ZEPHYR);
+    close(STATUS);
+    exit 0;
+}
+
+#printf(STDERR "Job priority %s\n", $opts{'C'}) if $opts{'C'} eq 'Z';
+#printf(ZEPHYR "Job priority %s\n", $opts{'C'}) if ($opts{'C'} && ($opts{'C'} ne 'A'));
+close(ZEPHYR);
+close(STATUS);
+play_mplayer_audio($filepath, \%opts);
+
+if ($magic) {
+    unlink($newpath);
+    rmdir($tempdir);
+}
+
+# Play an external stream reference
+sub resolve_external_reference {
+    # Retrieve those command line opts.
+    my ($filepath, $opts) = @_;
+
+    my $format, $uri, $userpass;
+
+    if (<STDIN> =~ /^(\S+)/) {
+	$uri=$1;
+
+        if ($uri =~ m|http://www\.youtube\.com/watch\?v=|) {
+            return $uri;
+        }
+
+	my $response = $ua->head($uri);
+	
+	$contenttype=($response->content_type() or "unknown");
+	
+	if ($contenttype eq "audio/mpeg") { $format="MP3" }
+	elsif ($contenttype eq "application/x-ogg") { $format="OGG" }
+	elsif ($contenttype eq "application/ogg") { $format="OGG" }
+	elsif ($contenttype eq "audio/x-scpls") { $format="SHOUTCAST" }
+	else {
+	    print ZEPHYR
+		"Unknown Content-Type $contenttype for URI $uri\n";
+	}
+    } else {
+        print ZEPHYR "Couldn't read URI for external reference\n";
+	return $filepath;
+    }
+
+    if ($format eq "SHOUTCAST") {
+	print ZEPHYR "Shoutcast playlist...\n";
+	#Don't close ZEPHYR yet, will print the name of the stream if available
+	return &get_shoutcast($uri);
+    } elsif ($format eq "MP3") {
+    } elsif ($format eq "OGG") {
+    } else {
+      print ZEPHYR "Unrecognized stream format: $format\n";
+    }
+    return $uri;
+}
+
+sub split_playlist {
+    my ($file, $opts) = @_;
+
+    my $i = 0;
+    
+    while (<STDIN>) {
+	chomp;
+	if (/^([^#]\S+)/) {
+	    printf (STDERR "Found line: %s\n", $_);
+	    open(LPR, "|-", 'mit-lpr', '-P'.$queue.'@localhost', '-CZ', '-J'.$opts->{J});
+	    print LPR $1;
+	    close(LPR);
+	$i++;
+	}
+    }
+    printf(ZEPHYR "Playlist containing %d valid entries, split into separate jobs.\n", $i);
+}
+
+# Process a Shoutcast playlist
+# get_shoutcast(URI)
+sub get_shoutcast {
+  my $uri = shift(@_);
+  
+  my $response = $ua->get($uri);
+
+  foreach (split("\n", $response->content())) {
+      if (/^File\d+=(\S+)/) {
+	  push(@uris, $1);
+      }
+      if (/^Title\d+=(.+)$/) {
+	  push(@titles, $1);
+      }
+  }
+  
+  # choose a random server
+  $server = int(rand scalar(@uris));
+  # print the name of the stream if available
+  print ZEPHYR "$titles[$server]\n";
+  return $uris[$server];
+}
+
+sub play_mplayer_audio {
+    my ($filepath, $opts) = @_;
+
+    # Prepare to write status:
+    open(ZEPHYR, '|/usr/athena/bin/zwrite -d -n -c '.$zephyr_class.' -i ' .
+	 $queue.'@'.$host.' -s "SIPB LPR music spooler"');
+    
+    # fork for mpg123
+    my $pid = open(MP3STATUS, "-|");
+    unless (defined $pid) {
+	print ZEPHYR "Couldn't fork: $!\n";
+	close(ZEPHYR);
+	return;
+    }
+    
+    if ($pid) { #parent
+	# Check if there were any errors
+	if ($_ = <MP3STATUS>) {
+	    print ZEPHYR "Playback completed with the following errors:\n";
+	    print ZEPHYR $_;
+	    while (<MP3STATUS>) {
+		print ZEPHYR $_;
+	    }
+	} else {
+	    print ZEPHYR "Playback completed successfully.\n";
+	}
+	close(MP3STATUS) || print ZEPHYR "mplayer exited $?\n";
+	
+	close(ZEPHYR);
+        open(STATUS, '>', '/var/run/sipbmp3/status');
+        close(STATUS);
+    }
+  else { # child
+      # redirect STDERR to STDOUT
+      open STDERR, '>&STDOUT';
+      # make sure that mplayer doesn't try to intepret the file as keyboard input
+      close(STDIN);
+      open(STDIN, "/dev/null");
+      #print STDERR Dumper([qw|/usr/bin/mplayer -nolirc -ao alsa -quiet|, $filepath]);
+      my @args = (qw|/usr/bin/mplayer -novideo -vo null -nolirc -ao alsa -cache 512 -really-quiet |, $filepath);
+      #print STDERR "About to exec: ", Dumper([@args]);
+      exec(@args) ||
+	  die "Couldn't exec";
+  }
+}
+
+# ID3 comments often have useless crap because tools like iTunes were
+# written by drooling idiots
+sub filter_comment {
+  my $comment = shift(@_);
+
+  if ($comment =~ /^engiTunes_CDDB/) {
+    return undef;
+  }
+  return $comment;
+}
+
+
Index: debian/sipbmp3-filter-config.pl
===================================================================
--- debian/sipbmp3-filter-config.pl	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/sipbmp3-filter-config.pl	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,3 @@
+$zephyr_class = "my_auto_class"
+$host = "hostname"
+$queue = "printername"
Index: debian/sipbmp3.dirs
===================================================================
--- debian/sipbmp3.dirs	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/sipbmp3.dirs	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,1 @@
+var/lib/debathena-counterlog
Index: debian/sipbmp3.init
===================================================================
--- debian/sipbmp3.init	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/sipbmp3.init	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+case "$1" in
+  start)
+    mkdir /var/run/sipbmp3
+    touch /var/run/sipbmp3/status
+    chmod 0777 /var/run/sipbmp3/status
+    ;;
+  stop)
+    rm -r /var/run/sipbmp3
+    ;;
+  restart)
+    rm -r /var/run/sipbmp3
+    mkdir /var/run/sipbmp3
+    touch /var/run/sipbmp3/status
+    chmod 0777 /var/run/sipbmp3/status
+    ;;
+  *)
+    echo "Usage: /etc/init.d/sipbmp3 {start|stop|restart}" >&2
+    exit 1
+    ;;
+esac
Index: debian/sipbmp3.install
===================================================================
--- debian/sipbmp3.install	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/sipbmp3.install	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,2 @@
+debian/root/* /root/sipbmp3/
+debian/sipbmp3-filter-config.pl /etc/
Index: debian/sipbmp3.install~
===================================================================
--- debian/sipbmp3.install~	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
+++ debian/sipbmp3.install~	(revision c7b9feb57cd7a9eda151935b08408fa0628909f1)
@@ -0,0 +1,13 @@
+debian/root/cd-cddb /root/sipbmp3/
+debian/root/cd-cddb-get /root/sipbmp3
+debian/root/cd-play /root/sipbmp3
+debian/root/status-clear /root/sipbmp3
+debian/root/status-get /root/sipbmp3
+debian/root/voldaemon.c /root/sipbmp3
+debian/root/volume-down /root/sipbmp3
+debian/root/volume-get /root/sipbmp3
+debian/root/volume-help /root/sipbmp
+debian/root/volume-mute /root/sipbmp3
+debian/root/volume-set /root/sipbmp3
+debian/root/volume-up /root/sipbmp3
+debian/sipbmp3-filter-config.pl /etc/
Index: tenbach/debian/lib/README
===================================================================
--- gutenbach/debian/lib/README	(revision edce45f8d0270e10ed1db13d1d86598c88a671c6)
+++ 	(revision )
@@ -1,20 +1,0 @@
-If you want to help make changes to gutenbach, do NOT make changes
-locally!  They will most likely get overwritten by the next package
-install.  Instead, you should check out the source and edit the
-package itself:
-
-/afs/sipb/project/sipbmp3/gutenbach.git
-
-It may be useful to just edit things locally to make sure they work,
-and then add the change into the package.
-
-zsr (in SIPB) is set up to build packages, and already has a git clone
-in /root/gutenbach.  You can edit the source there, build the package,
-and then reinstall the package.
-
-A good guide to get started with debian packaging is here:
-http://debathena.mit.edu/packaging/
-
-jhamrick (Jessica Hamrick) is currently the active maintainer for
-gutenbach, so if you're interested in contributing but don't know
-quite where to start, you should talk to her.
Index: tenbach/debian/lib/TODO
===================================================================
--- gutenbach/debian/lib/TODO	(revision 5239eb5b42663124f8768366b84580158141859f)
+++ 	(revision )
@@ -1,2 +1,0 @@
-- gutenbach-get-config should fail and error out if it can't find a
-   config file -- we can't use defaults since what would the defaults be?
Index: tenbach/debian/lib/gutenbach
===================================================================
--- gutenbach/debian/lib/gutenbach	(revision cab423ccda6314f4e06a375763955a2023994304)
+++ 	(revision )
@@ -1,314 +1,0 @@
-#!/usr/bin/perl
-# Play the data on STDIN as an audio file
-#
-# $Id: gutenbach-filter,v 1.26 2009/02/20 00:27:17 geofft Exp root $
-# $Source: /usr/local/bin/RCS/gutenbach-filter,v $
-#
-# TODO
-# ----
-# Make this structured code. It's a mess.
-# Repeat what we just played for EXT files too
-# Support HTTP Auth on ogg streams
-# License, cleanup and package
-#
-# Jered Floyd <jered@mit.edu> takes very little credit for this code
-# apparently neither does Quentin Smith <quentin@mit.edu>
-
-use strict;
-use warnings;
-use Image::ExifTool qw(ImageInfo);
-use File::Spec::Functions;
-use File::Temp qw{tempfile tempdir};
-use File::Basename qw(basename);
-use LWP::UserAgent;
-use Data::Dumper;
-use IPC::Open2;
-use English;
-
-require "/usr/lib/gutenbach/config/gutenbach-filter-config.pl" or die "Unable to load configuration";
-
-my $ua = new LWP::UserAgent;
-
-# Replace STDERR with a log file in /tmp.
-open(CUPS, ">&STDERR") or die "Unable to copy CUPS filehandle";
-close(STDERR);
-open(STDERR, ">>", "/tmp/gutenbach.log") or warn "Couldn't open log: $!";
-
-# Set the TERM environment (for the benefit of mplayer?)
-# I don't know why we do this --quentin
-$ENV{"TERM"}="vt100";
-
-print STDERR "STDERR FROM SPOOL FILTER\n";
-
-# CUPS provides us with these arguments:
-#
-# argv[1]
-# The job ID
-# argv[2]
-# The user printing the job
-# argv[3]
-# The job name/title
-# argv[4]
-# The number of copies to print
-# argv[5]
-# The options that were provided when the job was submitted
-# argv[6]
-# The file to print (first program only)
-#
-# The scheduler runs one or more of these programs to print any given
-# job. The first filter reads from the print file and writes to the
-# standard output, while the remaining filters read from the standard
-# input and write to the standard output. The backend is the last
-# filter in the chain and writes to the device.
-
-printf(STDERR "Got \@ARGV: %s\n", Dumper(\@ARGV));
-
-my %arguments = (
-		 job-id => $ARGV[0],
-		 user => $ARGV[1],
-		 job-title => $ARGV[2],
-		 copies => $ARGV[3],
-		 options => {split(/[= ]/, $ARGV[4])},
-		 file => $ARGV[5],
-		);
-
-# If we weren't given a filename, we need to read from stdin. Since
-# mplayer really wants a file, let's write out to a temporary file
-# first.
-if (!$arguments{"file"}) {
-  my ($fh, $file) = tempfile("gutenbachXXXXX", UNLINK => 1); # Ask File::Temp for a safe temporary file
-  my $buf;
-  while (read(STDIN, $buf, 1024*1024)) { # Read 1M at a time and put it in the temporary file
-    print $fh $buf;
-  }
-  close($fh);
-}
-
-printf(STDERR "Got \%arguments: %s\n", Dumper(\%arguments));
-
-# Open up a zwrite command to announce the current track.
-my @zwrite_command = (qw(/usr/bin/zwrite -d -n -c), $zephyr_class, "-i", $queue.'@'.$host, "-s", "Gutenbach Music Spooler");
-
-print STDERR "Invoking @zwrite_command\n";
-open(ZEPHYR, "|-", @zwrite_command) or die "Couldn't launch zwrite: $!";
-
-print(ZEPHYR "$arguments{user}\@$arguments{options}{job-originating-host-name} is playing:\n");
-my $status = "User: $arguments{user}\@$arguments{options}{job-originating-host-name}.");
-
-# SIGHUP handler, in case we were aborted
-sub clear_status {
-  my @zwrite_command = (qw(/usr/bin/zwrite -d -n -c), $zephyr_class, "-i", $queue.'@'.$host, "-s", "Gutenbach Music Spooler");
-  open(ZEPH, "|-", @zwrite_command);
-  print(ZEPH "Playback aborted.\n");
-  close(ZEPH);
-  die;
-}
-$SIG{HUP} = \&clear_status;
-
-# Read the metadata information from the file.
-my ($filepath) = $options{"file"};
-my ($fileinfo) = ImageInfo($filepath);
-my ($magic) = $fileinfo->{FileType};
-
-if ($magic) {
-  # $magic means that Image::ExifTool was able to identify the type of file
-  printf(ZEPHYR "%s file %s\n", $magic, $arguments{"job-title"});
-  $status .= sprintf(" Filetype: %s.", $magic);
-  $status .= sprintf(" Filename: %s.", $arguments{"job-title"});
-
-  if (exists $fileinfo->{'Title'}) {
-    printf(ZEPHYR "\@b{%s}\n", $fileinfo->{'Title'}) if exists $fileinfo->{'Title'};
-    $status .= sprintf(" Title: %s.", $fileinfo->{'Title'});
-  }
-  foreach my $key (qw/Artist Album AlbumArtist/) {
-    if (exists $fileinfo->{$key}) {
-      printf(ZEPHYR "%s\n", $fileinfo->{$key}) if exists $fileinfo->{$key};
-      $status .= sprintf(" %s: %s\n", $key, $fileinfo->{$key});
-    }
-  }
-
-  my $tempdir = tempdir();
-  #awful hack -- geofft
-  #== -- quentin
-  # This code appears to create a new temporary directory and symlink
-  # the job file into the temporary directory under the original
-  # filename. I think this is because mplayer sometimes uses the file
-  # extension to identify a filetype.
-  my $newpath = $tempdir . '/' . basename($arguments{"job-title"});
-  symlink($filepath, $newpath);
-  $filepath = $newpath;
-}
-elsif ($arguments{copies} == 42) {
-  # This is a flag that is set by jobs queued by split_playlist(); it tells us to not try to split the playlist again.
-  # Call resolve_external_reference to apply some heuristics to determine the filetype.
-  $filepath = resolve_external_reference($filepath, \%arguments);
-  if ($filepath =~ m|http://www\.youtube\.com/watch\?v=|) {
-    # YouTube URLs are resolved by the youtube-dl command.
-    # Launch youtube-dl
-    open(YTDL, "-|", "youtube-dl", "-g", $filepath) or die "Unable to invoke youtube-dl";
-    # Read the title (currently not doing so because youtube-dl doesn't know how to get the title.
-    my $title = ""; # <YTDL>
-    # Print the title to zephyr and the status string.
-    print ZEPHYR "YouTube video $filepath\n$title";
-    $status .= " YouTube video $filepath. $title.";
-    # youtube-dl prints the URL of the flash video, which we pass to mplayer as a filename.
-    $filepath = <YTDL>;
-    chomp $filepath;
-  } else { # Doesn't appear to be a YouTube URL.
-    print STDERR "Resolved external reference to $filepath\n";
-    printf(ZEPHYR "%s\n", $filepath);
-    $status .= sprintf(" External: %s\n", $filepath);
-  }
-}
-elsif (-T $filepath) { # If the file appears to be a text file, treat it as a playlist.
-  split_playlist($filepath, \%arguments);
-  close(ZEPHYR);
-  # See http://www.cups.org/documentation.php/api-filter.html#MESSAGES
-  print CUPS "NOTICE: $status\n";
-  exit 0;
-}
-
-close(ZEPHYR);
-print CUPS "NOTICE: $status\n";
-play_mplayer_audio($filepath, \%arguments);
-
-# Remove the symlink we made earlier for the filetype.
-if ($magic) {
-  unlink($newpath);
-  rmdir($tempdir);
-}
-
-# Play an external stream reference
-sub resolve_external_reference {
-  # Retrieve those command line opts.
-  my ($filepath, $arguments) = @_;
-
-  my $format, $uri, $userpass;
-
-  open(FILE, "<", $filepath) or die "Couldn't open spool file";
-  if (<FILE> =~ /^(\S+)/) {
-    # Take the leading non-whitespace as a URL
-    $uri=$1;
-
-    if ($uri =~ m|http://www\.youtube\.com/watch\?v=|) {
-      return $uri;
-    }
-
-    # Fetch the URL with a HEAD request to get the content type
-    my $response = $ua->head($uri);
-
-    my $contenttype=($response->content_type() or "unknown");
-
-    if ($contenttype eq "audio/mpeg") { $format="MP3" }
-    elsif ($contenttype eq "application/x-ogg") { $format="OGG" }
-    elsif ($contenttype eq "application/ogg") { $format="OGG" }
-    elsif ($contenttype eq "audio/x-scpls") { $format="SHOUTCAST" }
-    else {
-      print ZEPHYR
-	"Unknown Content-Type $contenttype for URI $uri\n";
-    }
-  } else { # Unable to match the URL regex
-    print ZEPHYR "Couldn't read URI for external reference\n";
-    # Return the existing path, in the hopes that mplayer knows what to do with it.
-    return $filepath;
-  }
-
-  if ($format eq "SHOUTCAST") {
-    print ZEPHYR "Shoutcast playlist...\n";
-    return get_shoutcast($uri);
-  } elsif ($format eq "MP3") {
-  } elsif ($format eq "OGG") {
-  } else {
-    print ZEPHYR "Unrecognized stream format: $format\n";
-  }
-  return $uri;
-}
-
-sub split_playlist {
-  my ($file, $arguments) = @_;
-
-  my $i = 0;
-
-  open(FILE, "<", $filepath) or die "Couldn't open spool file";
-  while (<FILE>) {
-    chomp;
-    if (/^([^#]\S+)/) {
-      printf (STDERR "Found playlist line: %s\n", $_);
-      open(LPR, "|-", 'lpr', '-P'.$queue.'@localhost', '-#', '42', '-J', $arguments->{"job-title"}, '-o', 'job-priority=100');
-      print LPR $1;
-      close(LPR);
-      $i++;
-    }
-  }
-  printf(ZEPHYR "Playlist containing %d valid entries, split into separate jobs.\n", $i);
-}
-
-# Process a Shoutcast playlist
-# get_shoutcast(URI)
-sub get_shoutcast {
-  my $uri = shift(@_);
-
-  my $response = $ua->get($uri);
-
-  foreach (split("\n", $response->content())) {
-      if (/^File\d+=(\S+)/) {
-	  push(@uris, $1);
-      }
-      if (/^Title\d+=(.+)$/) {
-	  push(@titles, $1);
-      }
-  }
-
-  # choose a random server
-  $server = int(rand scalar(@uris));
-  # print the name of the stream if available
-  print ZEPHYR "$titles[$server]\n";
-  return $uris[$server];
-}
-
-sub play_mplayer_audio {
-  my ($filepath, $opts) = @_;
-
-
-  # Open up a zwrite command to show the mplayer output
-  my @zwrite_command = (qw(/usr/bin/zwrite -d -n -c), $zephyr_class, "-i", $queue.'@'.$host, "-s", "Gutenbach Music Spooler");
-
-  print STDERR "Invoking @zwrite_command\n";
-  open(ZEPHYR, "|-", @zwrite_command) or die "Couldn't launch zwrite: $!";
-
-  # fork for mplayer
-  my $pid = open(MP3STATUS, "-|");
-  unless (defined $pid) {
-    print ZEPHYR "Couldn't fork: $!\n";
-    close(ZEPHYR);
-    return;
-  }
-
-  if ($pid) { #parent
-    # Check if there were any errors
-    if ($_ = <MP3STATUS>) {
-      print ZEPHYR "Playback completed with the following errors:\n";
-      print ZEPHYR $_;
-      while (<MP3STATUS>) {
-	print ZEPHYR $_;
-      }
-    } else {
-      print ZEPHYR "Playback completed successfully.\n";
-    }
-    close(MP3STATUS) || print ZEPHYR "mplayer exited $?\n";
-
-    close(ZEPHYR);
-  }
-  else { # child
-    # redirect STDERR to STDOUT
-    open STDERR, '>&STDOUT';
-    # make sure that mplayer doesn't try to intepret the file as keyboard input
-    close(STDIN);
-    open(STDIN, "/dev/null");
-
-    my @args = (qw|/usr/bin/mplayer -vo fbdev2 -zoom -x 1024 -y 768 -framedrop -nolirc -ao alsa -cache 512 -really-quiet |, $filepath);
-    #print STDERR "About to exec: ", Dumper([@args]);
-    exec(@args) ||
-      die "Couldn't exec";
-  }
-}
Index: tenbach/debian/lib/gutenbach-get-config
===================================================================
--- gutenbach/debian/lib/gutenbach-get-config	(revision a33a064dbb46562fa389d4da48c0a29abd82ca25)
+++ 	(revision )
@@ -1,35 +1,0 @@
-#!/usr/bin/perl
-use strict;
-# Get configuration of gutenbach
-
-my $zephyr_class = `hostname`;
-chomp($zephyr_class);
-my $host = `hostname`;
-chomp($zephyr_class);
-my $queue = "gutenbach";
-my $mixer = "PCM";
-my $channel = "Front Left";
-
-# Configuration
-my $config_file = "/usr/lib/gutenbach/config/gutenbach-filter-config.pl";
-if (-r $config_file) {
-    # Inline the configuration file
-    local $/;
-    my $fh;
-    open $fh, $config_file;
-    eval <$fh>;
-}
-
-my %config = (
-    'zephyr-class' => $zephyr_class,
-    'host' => $host,
-    'queue' => $queue,
-    'mixer' => $mixer,
-    'channel' => $channel,
-);
-
-foreach my $argv (@ARGV)
-{
-    #print $argv . "\n";
-    print $config{$argv};
-}
