From e6de467836d084a4184e646c01d49b15c081b346 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 6 Apr 2017 15:12:36 +0200 Subject: Improve ip resolving. --- bin/stream.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bin') 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/ -- cgit v1.2.3