diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2008-02-08 15:04:40 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2008-02-08 15:04:40 -0800 |
commit | 779df7e2f84b2750f33c073b2f310398d9f8a0fa (patch) | |
tree | 5978292710565815ff0e8308947732f61cc71650 /templates/show | |
parent | 4647ef1a3a84880cc7a52d2bf74163d7e470b150 (diff) | |
download | vyatta-op-779df7e2f84b2750f33c073b2f310398d9f8a0fa.tar.gz vyatta-op-779df7e2f84b2750f33c073b2f310398d9f8a0fa.zip |
- Fix bug 776: need "clear interface" command to clear counters
- Fix bug 1095: Enhancement Request: "Show interface brief" command
- Change default to "brief" if multiple interfaces can be shown
- Add "detail" for nodes defaulting to brief
- Add "brief" for nodes defaulting to detail
- Fix vif completions that wasn't working
- Remove ethtool can on vlans since it doesn't work
Diffstat (limited to 'templates/show')
22 files changed, 46 insertions, 19 deletions
diff --git a/templates/show/interfaces/bridge/detail/node.def b/templates/show/interfaces/bridge/detail/node.def new file mode 100644 index 0000000..442317a --- /dev/null +++ b/templates/show/interfaces/bridge/detail/node.def @@ -0,0 +1,2 @@ +help: Show detailed bridge interface information +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=bridge --action=show diff --git a/templates/show/interfaces/bridge/node.def b/templates/show/interfaces/bridge/node.def new file mode 100644 index 0000000..006dc64 --- /dev/null +++ b/templates/show/interfaces/bridge/node.def @@ -0,0 +1,2 @@ +help: Show bridge interface information +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=bridge --action=show-brief diff --git a/templates/show/interfaces/bridge/node.tag/brief/node.def b/templates/show/interfaces/bridge/node.tag/brief/node.def new file mode 100644 index 0000000..b277607 --- /dev/null +++ b/templates/show/interfaces/bridge/node.tag/brief/node.def @@ -0,0 +1,2 @@ +help: Show summary of a given bridge interface information +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 --action=show-brief diff --git a/templates/show/interfaces/bridge/node.tag/node.def b/templates/show/interfaces/bridge/node.tag/node.def new file mode 100644 index 0000000..9248741 --- /dev/null +++ b/templates/show/interfaces/bridge/node.tag/node.def @@ -0,0 +1,5 @@ +help: Show given bridge interface information +allowed: local -a array ; + array=( /sys/class/net/br* ) ; + echo -n ${array[@]##*/} +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 diff --git a/templates/show/interfaces/detail/node.def b/templates/show/interfaces/detail/node.def new file mode 100644 index 0000000..f875ce8 --- /dev/null +++ b/templates/show/interfaces/detail/node.def @@ -0,0 +1,2 @@ +help: Show detail information of all interfaces +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --action=show diff --git a/templates/show/interfaces/ethernet/detail/node.def b/templates/show/interfaces/ethernet/detail/node.def new file mode 100644 index 0000000..9883539 --- /dev/null +++ b/templates/show/interfaces/ethernet/detail/node.def @@ -0,0 +1,2 @@ +help: Show ethernet interface information +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=ethernet --action=show diff --git a/templates/show/interfaces/ethernet/node.def b/templates/show/interfaces/ethernet/node.def index 9ece668..5c31928 100644 --- a/templates/show/interfaces/ethernet/node.def +++ b/templates/show/interfaces/ethernet/node.def @@ -1,2 +1,2 @@ help: Show ethernet interface information -run: ${vyatta_bindir}/vyatta-show-interfaces ethernet +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=ethernet --action=show-brief diff --git a/templates/show/interfaces/ethernet/node.tag/brief/node.def b/templates/show/interfaces/ethernet/node.tag/brief/node.def new file mode 100644 index 0000000..52b3870 --- /dev/null +++ b/templates/show/interfaces/ethernet/node.tag/brief/node.def @@ -0,0 +1,2 @@ +help: Show given ethernet interface information +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 --action=show-brief diff --git a/templates/show/interfaces/ethernet/node.tag/node.def b/templates/show/interfaces/ethernet/node.tag/node.def index cf3e112..3dab472 100644 --- a/templates/show/interfaces/ethernet/node.tag/node.def +++ b/templates/show/interfaces/ethernet/node.tag/node.def @@ -1,5 +1,9 @@ help: Show given ethernet interface information -allowed: local -a array ; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} -run: ${vyatta_bindir}/vyatta-show-interfaces ethernet $4 +allowed: for dev in /sys/class/net/*; + do if [[ -L $dev/device ]] + then if [[ $(cat $dev/type) -eq 1 ]] + then echo -n ${dev##*/} " " + fi + fi + done +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 diff --git a/templates/show/interfaces/ethernet/node.tag/physical/node.def b/templates/show/interfaces/ethernet/node.tag/physical/node.def index a9628fd..98f0170 100644 --- a/templates/show/interfaces/ethernet/node.tag/physical/node.def +++ b/templates/show/interfaces/ethernet/node.tag/physical/node.def @@ -1,3 +1,3 @@ help: Show physical device information of given ethernet interface allowed: "" -run: sudo ${vyatta_bindir}/sudo-users/ethtool $4 +run: sudo ${vyatta_bindir}/sudo-users/ethtool $4; sudo ${vyatta_bindir}/sudo-users/ethtool -i $4 diff --git a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/brief/node.def b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/brief/node.def new file mode 100644 index 0000000..956be62 --- /dev/null +++ b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/brief/node.def @@ -0,0 +1,2 @@ +help: Show given virtual network interface information +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4.$6 --action=show-brief diff --git a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def index 68d3b02..813637b 100644 --- a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def +++ b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def @@ -1,5 +1,5 @@ help: Show given virtual network interface information -allowed: for eth in /sys/class/net/eth${4}.* ; do - echo ${eth/*eth${4}./} ; - done -run: ${vyatta_bindir}/vyatta-show-interfaces ethernet $4 vif $6 +allowed: local -a array ; + array=( /sys/class/net/${COMP_WORDS[3]}.* ) ; + echo -n ${array[@]##*.} +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4.$6 diff --git a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def deleted file mode 100644 index 9769aaa..0000000 --- a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def +++ /dev/null @@ -1,2 +0,0 @@ -help: Show given virtual network interface pseudo-physical information -run: sudo ${vyatta_bindir}/sudo-users/ethtool $4.$6 diff --git a/templates/show/interfaces/loopback/detail/node.def b/templates/show/interfaces/loopback/detail/node.def new file mode 100644 index 0000000..759407a --- /dev/null +++ b/templates/show/interfaces/loopback/detail/node.def @@ -0,0 +1,2 @@ +help: Show loopback interface information +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=loopback diff --git a/templates/show/interfaces/loopback/node.def b/templates/show/interfaces/loopback/node.def index cbf6238..bee95ea 100644 --- a/templates/show/interfaces/loopback/node.def +++ b/templates/show/interfaces/loopback/node.def @@ -1,3 +1,2 @@ help: Show loopback interface information -run: ${vyatta_bindir}/vyatta-show-interfaces loopback - +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=loopback --action=show-brief diff --git a/templates/show/interfaces/loopback/node.tag/brief/node.def b/templates/show/interfaces/loopback/node.tag/brief/node.def new file mode 100644 index 0000000..ca5cc37 --- /dev/null +++ b/templates/show/interfaces/loopback/node.tag/brief/node.def @@ -0,0 +1,2 @@ +help: Show summary of given loopback interface information +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 --action=show-brief diff --git a/templates/show/interfaces/loopback/node.tag/node.def b/templates/show/interfaces/loopback/node.tag/node.def index f1c11ed..ff6eec5 100644 --- a/templates/show/interfaces/loopback/node.tag/node.def +++ b/templates/show/interfaces/loopback/node.tag/node.def @@ -2,4 +2,4 @@ help: Show given loopback interface information allowed: local -a array ; array=( /sys/class/net/lo* ) ; echo -n ${array[@]##*/} -run: ${vyatta_bindir}/vyatta-show-interfaces loopback $4 +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 diff --git a/templates/show/interfaces/node.def b/templates/show/interfaces/node.def index c898266..aac2ea3 100644 --- a/templates/show/interfaces/node.def +++ b/templates/show/interfaces/node.def @@ -1,2 +1,2 @@ help: Show network interface information -run: ${vyatta_bindir}/vyatta-show-interfaces +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --action=show-brief diff --git a/templates/show/interfaces/tunnel/detail/node.def b/templates/show/interfaces/tunnel/detail/node.def new file mode 100644 index 0000000..d3c8d95 --- /dev/null +++ b/templates/show/interfaces/tunnel/detail/node.def @@ -0,0 +1,2 @@ +help: Show tunnel interface information +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=tunnel --action=show
\ No newline at end of file diff --git a/templates/show/interfaces/tunnel/node.def b/templates/show/interfaces/tunnel/node.def index bfc03ba..568578b 100644 --- a/templates/show/interfaces/tunnel/node.def +++ b/templates/show/interfaces/tunnel/node.def @@ -1,3 +1,2 @@ help: Show tunnel interface information -run: ${vyatta_bindir}/vyatta-show-interfaces tunnel - +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=tunnel --action=show-brief diff --git a/templates/show/interfaces/tunnel/node.tag/brief/node.def b/templates/show/interfaces/tunnel/node.tag/brief/node.def new file mode 100644 index 0000000..cf2b8da --- /dev/null +++ b/templates/show/interfaces/tunnel/node.tag/brief/node.def @@ -0,0 +1,2 @@ +help: Show given tunnel interface information +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 --action=show-brief diff --git a/templates/show/interfaces/tunnel/node.tag/node.def b/templates/show/interfaces/tunnel/node.tag/node.def index c119ab0..12630bd 100644 --- a/templates/show/interfaces/tunnel/node.tag/node.def +++ b/templates/show/interfaces/tunnel/node.tag/node.def @@ -2,4 +2,4 @@ help: Show given tunnel interface information allowed: local -a array ; array=( /sys/class/net/tun* ) ; echo -n ${array[@]##*/} -run: ${vyatta_bindir}/vyatta-show-interfaces tunnel $4 +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 |