diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2008-01-15 14:45:00 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2008-01-15 14:45:00 -0800 |
commit | 92b56210508f31ea278652d5d3fdf6c893ef6485 (patch) | |
tree | 4efdbde4499dc9bb49c524b02417bb7bfcf6739b /templates/interfaces/ethernet | |
parent | 784d147f611929787844c87f4e0428bb6a0b5708 (diff) | |
download | vyatta-cfg-92b56210508f31ea278652d5d3fdf6c893ef6485.tar.gz vyatta-cfg-92b56210508f31ea278652d5d3fdf6c893ef6485.zip |
Filter out vlans from "show interfaces ethernet" help string.
Diffstat (limited to 'templates/interfaces/ethernet')
-rw-r--r-- | templates/interfaces/ethernet/node.def | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def index 66a5344..f3b4cac 100644 --- a/templates/interfaces/ethernet/node.def +++ b/templates/interfaces/ethernet/node.def @@ -2,12 +2,12 @@ tag: type: txt help: "Ethernet interface name" syntax: exec " \ - if [ -z \"`ip addr | grep $(@) `\" ]; then \ - echo ethernet interface $(@) doesn\\'t exist on this system ; \ + if [ -z \"`ip link | egrep -v 'eth[0-9]+[.]' | grep $(@)`\" ]; then \ + echo Invalid ethernet interface [$(@)]; \ exit 1 ; \ fi ; " update: "sudo ip link set $(@) up" ; "Error enabling dev $(@)" delete: "sudo ip link set $(@) down" ; "Error disabling dev $(@)" #allowed: local -a array ; -# array=( /sys/class/net/{eth,vmnet}* ) ; +# array=( /sys/class/net/{eth,vmnet}[0-9]+[^.] ) ; # echo -n ${array[@]##*/} |