mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
shairplay: Move to sound menu and sub-directory
Signed-off-by: Ted Hess <thess@kitschensync.net>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
config shairplay main
|
||||
option disabled '1'
|
||||
option respawn '1'
|
||||
option apname 'AirPlay'
|
||||
option port '5000'
|
||||
option password ''
|
||||
option hwaddr ''
|
||||
option ao_driver 'oss'
|
||||
option ao_devicename ''
|
||||
option ao_deviceid ''
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2014 OpenWrt.org
|
||||
|
||||
START=90
|
||||
USE_PROCD=1
|
||||
|
||||
append_arg() {
|
||||
local cfg="$1"
|
||||
local var="$2"
|
||||
local opt="$3"
|
||||
local def="$4"
|
||||
local val
|
||||
|
||||
config_get val "$cfg" "$var"
|
||||
[ -n "$val" -o -n "$def" ] && procd_append_param command $opt="${val:-$def}"
|
||||
}
|
||||
|
||||
start_instance() {
|
||||
local cfg="$1"
|
||||
local aux
|
||||
|
||||
config_get_bool aux "$cfg" 'disabled' '0'
|
||||
[ "$aux" = 1 ] && return 1
|
||||
|
||||
procd_open_instance
|
||||
|
||||
procd_set_param command /usr/bin/shairplay
|
||||
|
||||
append_arg "$cfg" apname "--apname" "AirPlay"
|
||||
append_arg "$cfg" port "--server_port"
|
||||
append_arg "$cfg" password "--password"
|
||||
append_arg "$cfg" hwaddr "--hwaddr"
|
||||
|
||||
append_arg "$cfg" ao_driver "--ao_driver"
|
||||
append_arg "$cfg" ao_devicename "--ao_devicename"
|
||||
append_arg "$cfg" ao_deviceid "--ao_deviceid"
|
||||
|
||||
config_get_bool aux "$cfg" 'respawn' '0'
|
||||
[ "$aux" = 1 ] && procd_set_param respawn
|
||||
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "shairplay"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load shairplay
|
||||
config_foreach start_instance shairplay
|
||||
}
|
||||
Reference in New Issue
Block a user