From 9750d3845bd5bbc2e5e76134b8c4a902faa9bce9 Mon Sep 17 00:00:00 2001 From: Epoch Qwert Date: Wed, 24 Dec 2014 07:31:09 -0600 Subject: added IPv6 support to hop0, peerip, and gopherd.sh gopherd.sh got lots of other updates too. speed is for measuring how many lines per second your pipes can do. --- nocompile/bin/hop0 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nocompile/bin/hop0') 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 -- cgit v1.2.3