florian 51584e3ed3 shairport: add AirPort Express emulation software
Signed-off-by: Florian Fainelli <florian@openwrt.org>

git-svn-id: svn://svn.openwrt.org/openwrt/packages@35746 3c298f89-4303-0410-b956-a3cf2f4a3e73
2013-02-22 14:52:38 +00:00

37 lines
618 B
Bash

#!/bin/sh /etc/rc.common
START=80
DAEMON="/usr/sbin/shairport"
config_shairport() {
local cfg="$1"
local args=""
config_get name "$cfg" name
config_get password "$cfg" password
config_get port "$cfg" port
config_get buffer "$cfg" buffer
[ -z $name ] && name="AirPort"
args="$args -a $name"
[ ! -z "$password" ] && args="$args -p $password"
[ ! -z "$port" ] && args="$args -o $port"
[ -z $buffer ] && buffer="256"
args="$args -b $buffer"
args="$args -d"
service_start $DAEMON $args
}
start() {
config_load shairport
config_foreach config_shairport shairport
}
stop() {
service_stop $DAEMON
}