From 642fd0b4893cd5afebafb58c82e418f12fdbf170 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 11 Feb 2009 15:58:50 -0800 Subject: OSPF: allow any type interface Bugfix 4014 Allow any interface name that might be configurable for passive-interface --- .../protocols/ospf/passive-interface/node.def | 42 ++++++++-------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/templates/protocols/ospf/passive-interface/node.def b/templates/protocols/ospf/passive-interface/node.def index 480d084e..841bd340 100644 --- a/templates/protocols/ospf/passive-interface/node.def +++ b/templates/protocols/ospf/passive-interface/node.def @@ -1,31 +1,17 @@ multi: type: txt help: Set to suppress routing updates on an interface -syntax:expression: exec " \ - if [ -z \"`ip addr | grep $VAR(@) `\" ] && [ x$VAR(@) != xdefault ]; then \ - echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \ - exit 1 ; \ - fi ; " -update:expression: " \ - if [ x$VAR(x) == xdefault ]; then \ - vyatta-vtysh -c \"configure terminal\" \ - -c \"router ospf\" \ - -c \"passive-interface default\"; \ - else \ - vyatta-vtysh -c \"configure terminal\" \ - -c \"router ospf\" \ - -c \"passive-interface $VAR(@)\"; \ - fi; " -delete:expression: " \ - if [ x$VAR(x) == xdefault ]; then \ - vyatta-vtysh -c \"configure terminal\" \ - -c \"router ospf\" \ - -c \"no passive-interface default\"; \ - else \ - vyatta-vtysh -c \"configure terminal\" \ - -c \"router ospf\" \ - -c \"no passive-interface $VAR(@)\"; \ - fi; " -allowed: local -a array; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} +syntax:expression: exec "${vyatta_sbindir}/vyatta-interfaces.pl --check $VAR(@)" +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all +update: if [ -z $VAR(@) ] + then vyatta-vtysh -c "configure terminal" -c "router ospf" \ + -c "passive-interface default"; + else vyatta-vtysh -c "configure terminal" -c "router ospf" \ + -c "passive-interface $VAR(@)" + fi +delete: if [ -z $VAR(@) ] + then vyatta-vtysh -c "configure terminal" -c "router ospf" \ + -c "no passive-interface default" + else vyatta-vtysh -c "configure terminal" -c "router ospf" \ + -c "no passive-interface $VAR(@)" + fi -- cgit v1.2.3