|
@@ -28,16 +28,21 @@ append_bool() {
|
28
|
28
|
|
29
|
29
|
start_instance() {
|
30
|
30
|
local cfg="$1"
|
31
|
|
- local ao dev
|
|
31
|
+ local ao dev aux
|
|
32
|
+
|
|
33
|
+ config_get_bool aux "$cfg" 'disabled' '0'
|
|
34
|
+ [ "$aux" = 1 ] && return 1
|
32
|
35
|
|
33
|
36
|
procd_open_instance
|
34
|
37
|
|
35
|
38
|
procd_set_param command /usr/bin/shairport
|
36
|
39
|
|
37
|
40
|
append_arg "$cfg" bname "-a" "AirPort"
|
38
|
|
- append_arg "$cfg" log "-l"
|
39
|
|
- append_arg "$cfg" buffer "-b" "256"
|
40
|
|
- append_arg "$cfg" port "-p" "5002"
|
|
41
|
+ append_arg "$cfg" log_file "-l"
|
|
42
|
+ append_arg "$cfg" err_file "-e"
|
|
43
|
+ append_arg "$cfg" meta_dir "-M"
|
|
44
|
+ append_arg "$cfg" buffer "-b"
|
|
45
|
+ append_arg "$cfg" port "-p"
|
41
|
46
|
append_arg "$cfg" password "-k"
|
42
|
47
|
append_arg "$cfg" mdns "-m"
|
43
|
48
|
|
|
@@ -58,8 +63,34 @@ start_instance() {
|
58
|
63
|
append_arg "$cfg" mixer_control "-c"
|
59
|
64
|
append_arg "$cfg" mixer_index "-i"
|
60
|
65
|
fi
|
|
66
|
+ elif [ "$ao" = "ao" ]; then
|
|
67
|
+ config_get dev "$cfg" ao_driver ""
|
|
68
|
+ if [ -n "$dev" ]; then
|
|
69
|
+ procd_append_param command "--"
|
|
70
|
+ append_arg "$cfg" ao_driver "-d"
|
|
71
|
+ append_arg "$cfg" ao_id "-i"
|
|
72
|
+ append_arg "$cfg" ao_name "-n"
|
|
73
|
+ append_arg "$cfg" ao_options "-o"
|
|
74
|
+ fi
|
|
75
|
+ elif [ "$ao" = "pipe" ]; then
|
|
76
|
+ config_get dev "$cfg" output_fifo ""
|
|
77
|
+ if [ -n "$dev" ]; then
|
|
78
|
+ procd_append_param command "--"
|
|
79
|
+ append_arg "$cfg" output_fifo ""
|
|
80
|
+ fi
|
|
81
|
+ elif [ "$ao" = "pulse" ]; then
|
|
82
|
+ config_get dev "$cfg" pulse_server ""
|
|
83
|
+ if [ -n "$dev" ]; then
|
|
84
|
+ procd_append_param command "--"
|
|
85
|
+ append_arg "$cfg" pulse_server "-a"
|
|
86
|
+ append_arg "$cfg" pulse_sink "-s"
|
|
87
|
+ append_arg "$cfg" pulse_appname "-n"
|
|
88
|
+ fi
|
61
|
89
|
fi
|
62
|
90
|
|
|
91
|
+ config_get_bool aux "$cfg" 'respawn' '0'
|
|
92
|
+ [ "$aux" = 1 ] && procd_set_param respawn
|
|
93
|
+
|
63
|
94
|
procd_close_instance
|
64
|
95
|
}
|
65
|
96
|
|