summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-08-21 18:34:34 +0200
committerGitHub <noreply@github.com>2019-08-21 18:34:34 +0200
commitbbbbfe2452cb78c894209671114bf6575ca5007e (patch)
tree6d4945c8b40dc378de30f3dbf9df1e9031ed95aa /scripts
parent437867584488ec3bf1bdd28ddfdd45410e9a5bf9 (diff)
parentab4371d058f8684fcbc501be34153b0d3b3c36db (diff)
downloadvyatta-op-bbbbfe2452cb78c894209671114bf6575ca5007e.tar.gz
vyatta-op-bbbbfe2452cb78c894209671114bf6575ca5007e.zip
Merge pull request #25 from alkersan/current
T1596 Remove telnet and traceroute operations after xml-style rewrite
Diffstat (limited to 'scripts')
-rw-r--r--scripts/vyatta-traceroute28
1 files changed, 0 insertions, 28 deletions
diff --git a/scripts/vyatta-traceroute b/scripts/vyatta-traceroute
deleted file mode 100644
index ca87a6d..0000000
--- a/scripts/vyatta-traceroute
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-ADDR=$1
-# Regular expressions for matching an ipv4 and ipv6 address
-# simple ipv4 matcher
-ip4regex="^(25[0-5]|2[0-4][0-9]|1[0-9]{1,2}|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}$"
-# based on IPv6 regex from here: http://forums.dartware.com/viewtopic.php?t=452
-ip6regex="^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:)))(%.+)?\s*$"
-
-# Main logic
-if [[ "$ADDR" =~ $ip4regex ]]; then
- /usr/bin/traceroute ${@:2} $ADDR
-elif [[ "$ADDR" =~ $ip6regex ]]; then
- /usr/bin/traceroute6 ${@:2} $ADDR
-else
- echo "Resolving Address: $ADDR"
- if host $ADDR | awk {' print $4 '} \
- | grep -m1 -E "$ip4regex">/dev/null; then
- # resolve address and check if it is ipv4 or other
- /usr/bin/traceroute ${@:2} $ADDR
- elif host $ADDR | awk {' print $5 '} \
- | grep -m1 -E "$ip6regex">/dev/null; then
- # if ipv6 resolution then ping6
- /usr/bin/traceroute6 ${@:2} $ADDR
- else
- echo -e "\n Unknown address: [$ADDR]\n"
- fi
-fi
-