@norskvideo/ctl-dev-kit 0.2.142 → 0.2.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,15 +4,24 @@
|
|
|
4
4
|
#
|
|
5
5
|
# scripts/test-feed.sh up|down
|
|
6
6
|
#
|
|
7
|
-
# FEED_HOST is where the demo runs
|
|
8
|
-
#
|
|
7
|
+
# FEED_HOST is where the demo runs; by default this machine's own network address
|
|
8
|
+
# (not 127.0.0.1, which Docker's userland proxy carries and drops under load); the
|
|
9
|
+
# port is SRT_IN_PORT from ctl/studio.env, else the workflow's 5001.
|
|
9
10
|
set -euo pipefail
|
|
10
11
|
root="$(cd "$(dirname "$0")/.." && pwd)"
|
|
11
12
|
|
|
12
13
|
# A setting from ctl/studio.env, or nothing: an unset one is not an error.
|
|
13
14
|
studio_env() { grep -E "^$1=" "$root/ctl/studio.env" 2>/dev/null | cut -d= -f2- || true; }
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
# This machine's primary IPv4 address, else 127.0.0.1 (no route, no `ip`, not Linux).
|
|
17
|
+
local_addr() {
|
|
18
|
+
local a=""
|
|
19
|
+
if [ "$(uname -s)" = Linux ] && command -v ip >/dev/null 2>&1; then
|
|
20
|
+
a=$(ip -4 route get 1.1.1.1 2>/dev/null | awk '{for (i = 1; i < NF; i++) if ($i == "src") { print $(i + 1); exit }}' || true)
|
|
21
|
+
fi
|
|
22
|
+
echo "${a:-127.0.0.1}"
|
|
23
|
+
}
|
|
24
|
+
host="${FEED_HOST:-$(local_addr)}"
|
|
16
25
|
port="$(studio_env SRT_IN_PORT)"
|
|
17
26
|
port="${port:-5001}"
|
|
18
27
|
passphrase="$(studio_env SRT_IN_PASSPHRASE)"
|