diff options
Diffstat (limited to 'templates/protocols')
9 files changed, 31 insertions, 64 deletions
diff --git a/templates/protocols/ospfv3/area/node.tag/interface/node.def b/templates/protocols/ospfv3/area/node.tag/interface/node.def index 384a225f..a45cfbff 100644 --- a/templates/protocols/ospfv3/area/node.tag/interface/node.def +++ b/templates/protocols/ospfv3/area/node.tag/interface/node.def @@ -1,17 +1,9 @@ type: txt help: Set OSPFv3 area interface -create:expression: "vyatta-vtysh --noerror -c \"configure terminal\" \ - -c \"router ospf6 \" \ - -c \"no interface $VAR(@) area $VAR(../@) \"; " -create:expression: "vyatta-vtysh -c \"configure terminal\" \ - -c \"router ospf6 \" \ - -c \"interface $VAR(@) area $VAR(../@) \"; " -delete:expression: "vyatta-vtysh -c \"configure terminal\" \ - -c \"router ospf6 \" \ - -c \"no interface $VAR(@) area $VAR(../@) \"; " - -allowed: for dev in /sys/class/net/*; - do if [[ -d $dev && -L $dev/device ]] - then echo -n ${dev##*/} " " - fi - done +create:vyatta-vtysh --noerror -c "configure terminal" -c "router ospf6" \ + -c "no interface $VAR(@) area $VAR(../@)" + vyatta-vtysh -c "configure terminal" -c "router ospf6" \ + -c "interface $VAR(@) area $VAR(../@)" +delete:vyatta-vtysh -c "configure terminal" -c "router ospf6" \ + -c "no interface $VAR(@) area $VAR(../@)" +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all diff --git a/templates/protocols/rip/distribute-list/interface/node.def b/templates/protocols/rip/distribute-list/interface/node.def index 46fe743d..749e5fb5 100644 --- a/templates/protocols/rip/distribute-list/interface/node.def +++ b/templates/protocols/rip/distribute-list/interface/node.def @@ -5,6 +5,4 @@ syntax:expression: exec "if [ -z \"`ip addr | grep $VAR(@) `\" ]; then echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \ exit 1 ; \ fi ; " -allowed: local -a array; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all diff --git a/templates/protocols/rip/interface/node.def b/templates/protocols/rip/interface/node.def index 8a1e560e..1cbbdaac 100644 --- a/templates/protocols/rip/interface/node.def +++ b/templates/protocols/rip/interface/node.def @@ -6,8 +6,6 @@ syntax:expression: exec " \ echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \ exit 1 ; \ fi ; " -create:expression: "vyatta-vtysh -c \"configure terminal\" -c \"router rip\" -c \"network $VAR(@)\" " -delete:expression: "vyatta-vtysh -c \"configure terminal\" -c \"router rip\" -c \"no network $VAR(@)\" " -allowed: local -a array; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} +create:vyatta-vtysh -c "configure terminal" -c "router rip" -c "network $VAR(@)" +delete:vyatta-vtysh -c "configure terminal" -c "router rip" -c "no network $VAR(@)" +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all diff --git a/templates/protocols/rip/passive-interface/node.def b/templates/protocols/rip/passive-interface/node.def index 1663df1b..09039331 100644 --- a/templates/protocols/rip/passive-interface/node.def +++ b/templates/protocols/rip/passive-interface/node.def @@ -6,20 +6,16 @@ syntax:expression: exec " \ 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 rip\" \ - -c \"passive-interface default\"; \ - else \ - vyatta-vtysh -c \"configure terminal\" -c \"router rip\" \ - -c \"passive-interface $VAR(@)\"; \ - fi; " -delete:expression: "if [ x$VAR(x) == xdefault ]; then \ - vyatta-vtysh -c \"configure terminal\" -c \"router rip\" \ - -c \"no passive-interface default\"; \ - else \ - vyatta-vtysh -c \"configure terminal\" -c \"router rip\" \ - -c \"no passive-interface $VAR(@)\"; \ - fi; " -allowed: local -a array; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} +update: if [ x$VAR(x) == xdefault ] + then vyatta-vtysh -c "configure terminal" -c "router rip" \ + -c "passive-interface default" + else vyatta-vtysh -c "configure terminal" -c "router rip" \ + -c "passive-interface $VAR(@)" + fi +delete: if [ x$VAR(x) == xdefault ] + then vyatta-vtysh -c "configure terminal" -c "router rip" \ + -c "no passive-interface default" + else vyatta-vtysh -c "configure terminal" -c "router rip" \ + -c "no passive-interface $VAR(@)" + fi +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all diff --git a/templates/protocols/ripng/distribute-list/interface/node.def b/templates/protocols/ripng/distribute-list/interface/node.def index 9219eda6..2c29dde8 100644 --- a/templates/protocols/ripng/distribute-list/interface/node.def +++ b/templates/protocols/ripng/distribute-list/interface/node.def @@ -1,13 +1,9 @@ tag: type: txt help: Set to apply filtering to an interface - +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all syntax:expression: exec "\ if [ -z \"`ip addr | grep $VAR(@) `\" ]; then \ echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \ exit 1 ; \ fi ; " - -allowed: local -a array; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} diff --git a/templates/protocols/ripng/interface/node.def b/templates/protocols/ripng/interface/node.def index 4aa81139..3a967735 100644 --- a/templates/protocols/ripng/interface/node.def +++ b/templates/protocols/ripng/interface/node.def @@ -1,21 +1,15 @@ multi: type: txt help: Set interface name - +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all syntax:expression: exec " \ if [ -z \"`ip addr | grep $VAR(@) `\" ]; then \ echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \ exit 1 ; \ fi ; " -create: vyatta-vtysh -c "configure terminal" \ - -c "router ripng" \ +create: vyatta-vtysh -c "configure terminal" -c "router ripng" \ -c "network $VAR(@)" -delete: vyatta-vtysh -c "configure terminal" \ - -c "router ripng" \ +delete: vyatta-vtysh -c "configure terminal" -c "router ripng" \ -c "no network $VAR(@)" - -allowed: local -a array; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} diff --git a/templates/protocols/ripng/passive-interface/node.def b/templates/protocols/ripng/passive-interface/node.def index 9654a1d3..4fe2e16b 100644 --- a/templates/protocols/ripng/passive-interface/node.def +++ b/templates/protocols/ripng/passive-interface/node.def @@ -1,7 +1,7 @@ multi: type: txt help: Set to suppress routing updates on an interface - +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all syntax:expression: exec " \ if [ -z \"`ip addr | grep $VAR(@) `\" ] && [ x$VAR(@) != xdefault ]; then \ echo ethernet interface $VAR(@) doesn\\'t exist on this system ; \ @@ -26,6 +26,3 @@ delete: if [ x$VAR(x) == xdefault ]; then -c "router ripng" \ -c "no passive-interface $VAR(@)"; fi; -allowed: local -a array; - array=( /sys/class/net/{eth,vmnet}* ) ; - echo -n ${array[@]##*/} diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def index c22c9305..cd739481 100644 --- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def +++ b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def @@ -3,9 +3,7 @@ type: txt help: Set the next-hop interface # show all current interface # but syntax accepts any interface since it may exist later (ppp etc) -allowed: local -a array - array=( /sys/class/net/* ) - echo -n ${array[@]##*/} +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all end: if [ ${COMMIT_ACTION} = 'DELETE' ]; then diff --git a/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.def b/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.def index a7e1744a..052e1a2f 100644 --- a/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.def +++ b/templates/protocols/static/interface-route6/node.tag/next-hop-interface/node.def @@ -3,9 +3,7 @@ type: txt help: Set the next-hop interface # show all current interface # but syntax accepts any interface since it may exist later (ppp etc) -allowed: local -a array - array=( /sys/class/net/* ) - echo -n ${array[@]##*/} +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all end: if [ ${COMMIT_ACTION} = 'DELETE' ]; then vyatta-vtysh -c "configure terminal" \ |