Skip to content

Commit

Permalink
Allow to override go2rtc binary in add-on (#5876)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs authored Mar 30, 2023
1 parent 83c80c5 commit 1b8cd10
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docker/rootfs/etc/s6-overlay/s6-rc.d/go2rtc/run
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,17 @@ if [[ ! -f "/dev/shm/go2rtc.yaml" ]]; then
python3 /usr/local/go2rtc/create_config.py
fi

readonly config_path="/config"

if [[ -x "${config_path}/go2rtc" ]]; then
readonly binary_path="${config_path}/go2rtc"
echo "[WARN] Using go2rtc binary from '${binary_path}' instead of the embedded one" >&2
else
readonly binary_path="/usr/local/go2rtc/bin/go2rtc"
fi

echo "[INFO] Starting go2rtc..."

# Replace the bash process with the go2rtc process, redirecting stderr to stdout
exec 2>&1
exec go2rtc -config=/dev/shm/go2rtc.yaml
exec "${binary_path}" -config=/dev/shm/go2rtc.yaml

0 comments on commit 1b8cd10

Please sign in to comment.