Skip to content

Commit 43ff579

Browse files
authored
Restructure configuration apply (#116)
* Restructure configuration apply * fix tabs
1 parent da8354c commit 43ff579

File tree

1 file changed

+13
-8
lines changed
  • rootfs/etc/services.d/pulseaudio

1 file changed

+13
-8
lines changed

rootfs/etc/services.d/pulseaudio/run

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22
# ==============================================================================
33
# Start PulseAudio service
44
# ==============================================================================
5-
export PULSE_STATE_PATH="/data/states"
6-
export LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
7-
8-
debug="$(bashio::jq /data/pulse_audio.json '.debug')"
9-
log_level=""
5+
declare puluse_args=()
106

11-
if bashio::var.true "${debug}"; then
12-
log_level='-vvv'
7+
if bashio::file.exists /data/pulse_audio.json; then
8+
# Debug option
9+
if bashio::var.true "$(bashio::jq /data/pulse_audio.json '.debug')"; then
10+
puluse_args+=("-vvv")
11+
fi
12+
else
13+
bashio::log.warning "No supervisor configuration found"
1314
fi
1415

15-
exec pulseaudio --system --disallow-exit --exit-idle-time=-1 --disable-shm "$log_level"
16+
# Set env
17+
export PULSE_STATE_PATH="/data/states"
18+
export LD_PRELOAD="/usr/local/lib/libjemalloc.so.2"
19+
20+
exec pulseaudio --system --disallow-exit --exit-idle-time=-1 --disable-shm "${puluse_args[@]}"

0 commit comments

Comments
 (0)