diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:40:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:40:29 +0000 |
commit | d8323fbdaecdfbd18b4c2d052273e6ac3a81e5e2 (patch) | |
tree | d92c2612ea8b4104e0628c58d76565938d8bd014 /wrappers/tracepath | |
parent | Initial commit. (diff) | |
download | traceroute-d8323fbdaecdfbd18b4c2d052273e6ac3a81e5e2.tar.xz traceroute-d8323fbdaecdfbd18b4c2d052273e6ac3a81e5e2.zip |
Adding upstream version 1:2.1.5.upstream/1%2.1.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wrappers/tracepath')
-rwxr-xr-x | wrappers/tracepath | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/wrappers/tracepath b/wrappers/tracepath new file mode 100755 index 0000000..c7d3770 --- /dev/null +++ b/wrappers/tracepath @@ -0,0 +1,63 @@ +#!/bin/sh +# +# Copyright (c) 2008 Dmitry Butskoy +# <dmitry@butskoy.name> +# License: GPL v2 or any later +# +# See COPYING for the status of this software. +# + +# +# Shell wrapper providing tracepath(1) or tracepath6(1) command line interface. +# +# The original implementation of tracepath/tracepath6 can be obtained +# from the iputils package, available at http://www.skbuff.net/iputils/ +# + +opts="-q1 --mtu --back" +port=44444 +prgname=$0 +length="" + + +usage () { + echo "Usage: $prgname [-nbh] [ -l pktlen ] host[/port]" >&2 +} + + +PARSED=`getopt -- 'hnbl:' "$@"` +[ $? != 0 ] && exit 2 + +eval set -- "$PARSED" + +while [ $# -gt 0 ] +do + case "$1" in + -n) opts="$opts $1"; shift ;; + -b) shift ;; + -l) length=$2; shift 2 ;; + -h) usage ; exit 0 ;; + --) shift; break ;; + *) echo "$prgname: Internal parsing error" >&2; exit 2 ;; + esac +done + +[ $# -eq 0 ] && { + usage + exit 2 +} + +host=$1 +case "$host" in + */*) port=${host##*/} + host=${host%/*} + ;; +esac + + +case "$prgname" in + *6) opts="$opts -6" ;; +esac + +exec traceroute $opts -p $port $host $length + |