summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/protocols/ospf/passive-interface/node.def42
1 files 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