summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-06 15:12:36 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-12 09:24:06 +0200
commite6de467836d084a4184e646c01d49b15c081b346 (patch)
tree66cc17ad6e0292d31a21ca852627dc8be180722d /bin
parent3af6271518db6c79419d90738aa33b142c7b55d7 (diff)
Improve ip resolving.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/stream.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/stream.sh b/bin/stream.sh
index 9e44a14..adb6b3e 100755
--- a/bin/stream.sh
+++ b/bin/stream.sh
@@ -1,7 +1,11 @@
#!/bin/sh
target_host=morla
-target_ip=$(host "$target_host" | grep -Po 'address \K\S+' || echo 127.0.0.1)
+if [ "$target_host" = "$(hostname --short)" ]; then
+ target_ip=127.0.0.1
+else
+ target_ip=$(host "$target_host" | grep -Po 'address \K\S+')
+fi
# based on http://video.stackexchange.com/a/16933
# + codec options from http://www.webmproject.org/docs/encoder-parameters/