From 497ae17bf0853ab28888c44dd95c4077c311a0fa Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Wed, 31 Oct 2018 20:11:18 -0500 Subject: [PATCH] generic iproute output parsing Fixes #346 Fixes #312 --- docker_run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker_run.sh b/docker_run.sh index 8c6d2b7..fd7c3d3 100755 --- a/docker_run.sh +++ b/docker_run.sh @@ -1,6 +1,6 @@ #!/bin/bash # Lookups may not work for VPN / tun0 -IP_LOOKUP="$(ip route get 8.8.8.8 | awk '{ print $NF; exit }')" +IP_LOOKUP="$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')" IPv6_LOOKUP="$(ip -6 route get 2001:4860:4860::8888 | awk '{for(i=1;i<=NF;i++) if ($i=="src") print $(i+1)}')" # Just hard code these to your docker server's LAN IP if lookups aren't working