Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions rootfs/etc/s6-overlay/s6-rc.d/pulseaudio/run
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
#!/usr/bin/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Start PulseAudio service
# ==============================================================================
declare pulse_args=()

pulse_config() {
local cfgFile jsonObj
jsonObj="$1"
cfgFile="$2"
if bashio::jq.is_object /data/pulse_audio.json ".${jsonObj}"; then
while read -r key; do
if bashio::jq.has_value /data/pulse_audio.json ".${jsonObj}.\"${key}\""; then
value=$(bashio::jq /data/pulse_audio.json ".${jsonObj}.\"${key}\"")
sed -i -E "s/^.*${key} =.*$/${key} = ${value}/" "$cfgFile"
bashio::log.info "Overriding PulseAudio ${jsonObj} conf key '${key} with value '${value}'"
fi
done < <(bashio::jq /data/pulse_audio.json ".${jsonObj} | keys[]")
fi

}

if bashio::fs.file_exists /data/pulse_audio.json; then
# Debug option
if bashio::var.true "$(bashio::jq /data/pulse_audio.json '.debug')"; then
pulse_args+=("-vvv")
fi
# Customize pulse daemon config options
pulse_config 'daemon' '/etc/pulse/daemon.conf'
else
bashio::log.warning "No supervisor configuration found"
fi
Expand Down