From ed07cff15234b716d58c52dcf315ddc493d896e7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 11 Feb 2009 14:10:08 -0800 Subject: Use vyatta-interfaces --show to display allowed types Simple way to handle interface names for allowed: --- templates/show/interfaces/bonding/node.tag/node.def | 6 +----- templates/show/interfaces/bridge/node.tag/node.def | 4 +--- templates/show/interfaces/ethernet/node.tag/node.def | 8 +------- templates/show/interfaces/tunnel/node.tag/node.def | 4 +--- 4 files changed, 4 insertions(+), 18 deletions(-) (limited to 'templates/show') diff --git a/templates/show/interfaces/bonding/node.tag/node.def b/templates/show/interfaces/bonding/node.tag/node.def index 0cf4016..c2f1349 100644 --- a/templates/show/interfaces/bonding/node.tag/node.def +++ b/templates/show/interfaces/bonding/node.tag/node.def @@ -1,7 +1,3 @@ help: Show specified bonding interface information -allowed: for dev in /sys/class/net/*; - do if [[ -d $dev/bonding ]] - then echo -n ${dev##*/} " " - fi - done +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show bonding run: ${vyatta_bindir}/vyatta-show-bonding.pl "$4" diff --git a/templates/show/interfaces/bridge/node.tag/node.def b/templates/show/interfaces/bridge/node.tag/node.def index d2c5eec..18713b8 100644 --- a/templates/show/interfaces/bridge/node.tag/node.def +++ b/templates/show/interfaces/bridge/node.tag/node.def @@ -1,5 +1,3 @@ help: Show specified bridge interface information -allowed: local -a array ; - array=( /sys/class/net/br* ) ; - echo -n ${array[@]##*/} +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show bridge run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf="$4" diff --git a/templates/show/interfaces/ethernet/node.tag/node.def b/templates/show/interfaces/ethernet/node.tag/node.def index 57a5623..5563032 100644 --- a/templates/show/interfaces/ethernet/node.tag/node.def +++ b/templates/show/interfaces/ethernet/node.tag/node.def @@ -1,9 +1,3 @@ help: Show specified ethernet interface information -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 +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show ethernet run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf="$4" diff --git a/templates/show/interfaces/tunnel/node.tag/node.def b/templates/show/interfaces/tunnel/node.tag/node.def index 6818464..2382af4 100644 --- a/templates/show/interfaces/tunnel/node.tag/node.def +++ b/templates/show/interfaces/tunnel/node.tag/node.def @@ -1,5 +1,3 @@ help: Show specified tunnel interface information -allowed: local -a array ; - array=( /sys/class/net/tun* ) ; - echo -n ${array[@]##*/} +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show tunnel run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf="$4" -- cgit v1.2.3