summaryrefslogtreecommitdiff
path: root/templates/protocols
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2010-03-20 13:08:04 -0700
committerStig Thormodsrud <stig@vyatta.com>2010-03-20 13:08:04 -0700
commit442fd359980919f018107849240b63ce73bcffc3 (patch)
tree97624a57cd4208651e25c1b75f9f3a087b723068 /templates/protocols
parent369b7c567639d7230c945045c855c678fadfb887 (diff)
downloadvyatta-cfg-quagga-442fd359980919f018107849240b63ce73bcffc3.tar.gz
vyatta-cfg-quagga-442fd359980919f018107849240b63ce73bcffc3.zip
Fix 4161: Bad config handling of "protocols ospf passive-interface"
Diffstat (limited to 'templates/protocols')
-rw-r--r--templates/protocols/ospf/passive-interface/node.def46
1 files changed, 36 insertions, 10 deletions
diff --git a/templates/protocols/ospf/passive-interface/node.def b/templates/protocols/ospf/passive-interface/node.def
index 2ee24c93..bd66993e 100644
--- a/templates/protocols/ospf/passive-interface/node.def
+++ b/templates/protocols/ospf/passive-interface/node.def
@@ -1,19 +1,45 @@
multi:
type: txt
help: Set to suppress routing updates on an interface
+
allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all && echo default
-create: if [ -z $VAR(@) ]
- then vtysh -c "configure terminal" -c "router ospf" \
- -c "passive-interface default";
- else vtysh -c "configure terminal" -c "router ospf" \
- -c "passive-interface $VAR(@)"
- fi
+
+
+
+create: sudo /opt/vyatta/sbin/vyatta_quagga_utils.pl \
+ --check-ospf-passive="$VAR(@)"
+ if [ $? != 0 ] ; then
+ exit 1;
+ fi
+ if [ -z $VAR(@) ] || [ "$VAR(@)" == "default" ] ; then
+ vtysh -c "configure terminal" \
+ -c "router ospf" \
+ -c "passive-interface default";
+ else
+ vtysh -c "configure terminal" \
+ -c "router ospf" \
+ -c "passive-interface $VAR(@)"
+ fi
+
delete: if [ -z $VAR(@) ]
- then vtysh -c "configure terminal" -c "router ospf" \
- -c "no passive-interface default"
- else vtysh -c "configure terminal" -c "router ospf" \
- -c "no passive-interface $VAR(@)"
+ then
+ vtysh -c "configure terminal" \
+ -c "router ospf" \
+ -c "no passive-interface default"
+ else
+ if [ "$VAR(@)" == "default" ]
+ then
+ if [ $VAR(../passive-interface-exclude/@) ]
+ then
+ echo "Error: delete passive-interface-exclude before deleting passive-interface default";
+ exit 1;
+ fi
+ fi
+ vtysh -c "configure terminal" \
+ -c "router ospf" \
+ -c "no passive-interface $VAR(@)"
fi
+
comp_help: possible completions:
<interface> Set an interface to be passive (i.e. suppress routing updates)
default Set default to suppress routing updates on all interfaces