summaryrefslogtreecommitdiff
path: root/nocompile/bin
diff options
context:
space:
mode:
Diffstat (limited to 'nocompile/bin')
-rwxr-xr-xnocompile/bin/hop06
1 files changed, 5 insertions, 1 deletions
diff --git a/nocompile/bin/hop0 b/nocompile/bin/hop0
index 7dc0812..e7c3ff8 100755
--- a/nocompile/bin/hop0
+++ b/nocompile/bin/hop0
@@ -1,6 +1,10 @@
#!/bin/sh
if [ "_$(uname -s)" != "_Linux" ];then
- /sbin/route -n get "$1" | grep "local addr" | cut -d: -f2 | tr -d ' '
+ if echo $1 | grep ":" 2>&1 >/dev/null;then
+ /sbin/route -n get -inet6 "$1" | grep "local addr" | cut -d: -f2- | tr -d ' '
+ else
+ /sbin/route -n get "$1" | grep "local addr" | cut -d: -f2 | tr -d ' '
+ fi
else
/sbin/ip r g "$1" | cut '-d ' -f8
fi