diff options
Diffstat (limited to 'templates/traceroute')
-rw-r--r-- | templates/traceroute/ipv4/node.def | 4 | ||||
-rw-r--r-- | templates/traceroute/ipv4/node.tag/node.def | 25 | ||||
-rw-r--r-- | templates/traceroute/ipv6/node.def | 4 | ||||
-rw-r--r-- | templates/traceroute/ipv6/node.tag/node.def | 25 | ||||
-rw-r--r-- | templates/traceroute/node.def | 2 | ||||
-rw-r--r-- | templates/traceroute/node.tag/node.def | 23 |
6 files changed, 62 insertions, 21 deletions
diff --git a/templates/traceroute/ipv4/node.def b/templates/traceroute/ipv4/node.def new file mode 100644 index 0000000..2f618b1 --- /dev/null +++ b/templates/traceroute/ipv4/node.def @@ -0,0 +1,4 @@ +# +# Operational mode template for the "traceroute" command +# +help: Track network path to <hostname|IPv4 address> diff --git a/templates/traceroute/ipv4/node.tag/node.def b/templates/traceroute/ipv4/node.tag/node.def new file mode 100644 index 0000000..a37ae5b --- /dev/null +++ b/templates/traceroute/ipv4/node.tag/node.def @@ -0,0 +1,25 @@ +# +# Operational mode template for the "traceroute" command +# + +help: Track network path to specified <hostname|IPv4 address> +allowed: echo -n '<hostname> <x:x:x:x>' + +run: + if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv4 $3 + then + /usr/bin/traceroute $3 + echo + else + if cat /etc/resolv.conf 2> /dev/null | grep -q nameserver + then + if /usr/bin/host $3 &> /dev/null + then + /usr/bin/traceroute $3 + else + echo "Invalid IPv4 address or host name '$3'" + fi + else + echo "Either enter a valid IPv4 address or configure Domain Name Server to resolve host names" + fi + fi diff --git a/templates/traceroute/ipv6/node.def b/templates/traceroute/ipv6/node.def new file mode 100644 index 0000000..1075c44 --- /dev/null +++ b/templates/traceroute/ipv6/node.def @@ -0,0 +1,4 @@ +# +# Operational mode template for the "traceroute" command +# +help: Track network path to <hostname|IPv6 address> diff --git a/templates/traceroute/ipv6/node.tag/node.def b/templates/traceroute/ipv6/node.tag/node.def new file mode 100644 index 0000000..b746c3e --- /dev/null +++ b/templates/traceroute/ipv6/node.tag/node.def @@ -0,0 +1,25 @@ +# +# Operational mode template for the "traceroute" command +# + +help: Track network path to specified <hostname|IPv6 address> +allowed: echo -n '<hostname> <h:h:h:h:h:h:h:h>' + +run: + if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv6 $3 + then + /usr/bin/traceroute6 $3 + echo + else + if cat /etc/resolv.conf 2> /dev/null | grep -q nameserver + then + if /usr/bin/host $3 &> /dev/null + then + /usr/bin/traceroute6 $3 + else + echo "Invalid IPv6 address or host name '$3'" + fi + else + echo "Either enter a valid IPv6 address or configure Domain Name Server to resolve host names" + fi + fi diff --git a/templates/traceroute/node.def b/templates/traceroute/node.def index 2f618b1..28e695c 100644 --- a/templates/traceroute/node.def +++ b/templates/traceroute/node.def @@ -1,4 +1,4 @@ # # Operational mode template for the "traceroute" command # -help: Track network path to <hostname|IPv4 address> +help: Track network path to node diff --git a/templates/traceroute/node.tag/node.def b/templates/traceroute/node.tag/node.def index 7309798..7b90221 100644 --- a/templates/traceroute/node.tag/node.def +++ b/templates/traceroute/node.tag/node.def @@ -2,24 +2,7 @@ # Operational mode template for the "traceroute" command # -help: Track network path to specified <hostname|IPv4 address> -allowed: echo -n '<hostname> <x.x.x.x>' +help: Track network path to specified node +allowed: echo -n '<hostname> <x.x.x.x> <h:h:h:h:h:h:h:h>' -run: - if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv4 $2 - then - /usr/bin/traceroute $2 - echo - else - if cat /etc/resolv.conf 2> /dev/null | grep -q nameserver - then - if /usr/bin/host $2 &> /dev/null - then - /usr/bin/traceroute $2 - else - echo "Invalid IP address or host name '$2'" - fi - else - echo "Either enter a valid IPv4 address or configure Domain Name Server to resolve host names" - fi - fi +run: /opt/vyatta/bin/vyatta-traceroute $2 |