summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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/