summaryrefslogtreecommitdiff
path: root/nocompile/bin/hop0
diff options
context:
space:
mode:
authorEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-12-24 07:31:09 -0600
committerEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-12-24 07:31:09 -0600
commit9750d3845bd5bbc2e5e76134b8c4a902faa9bce9 (patch)
tree1b38f9a5a0e80eee6be6d93d33aeab0dd9ca641b /nocompile/bin/hop0
parent612926651db0c13fa9f45f58764b56ab132b211c (diff)
downloadmisc-9750d3845bd5bbc2e5e76134b8c4a902faa9bce9.tar.gz
misc-9750d3845bd5bbc2e5e76134b8c4a902faa9bce9.zip
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.
Diffstat (limited to 'nocompile/bin/hop0')
-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