From e1d0d9a781e5ccf7941809e8e75e607b2e9197c9 Mon Sep 17 00:00:00 2001 From: Robert Bays Date: Fri, 14 Mar 2008 13:18:28 -0700 Subject: fix for bugs 2725 and 2999 --- templates/protocols/bgp/node.tag/network/node.def | 50 +++++++++++----------- .../node.tag/network/node.tag/.backdoor/node.def | 1 - .../node.tag/network/node.tag/backdoor/node.def | 1 + 3 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 templates/protocols/bgp/node.tag/network/node.tag/.backdoor/node.def create mode 100644 templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def (limited to 'templates/protocols') diff --git a/templates/protocols/bgp/node.tag/network/node.def b/templates/protocols/bgp/node.tag/network/node.def index acd2475b..c6061749 100644 --- a/templates/protocols/bgp/node.tag/network/node.def +++ b/templates/protocols/bgp/node.tag/network/node.def @@ -1,31 +1,31 @@ tag: type: ipv4net help: Specify a network to announce via BGP -syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $VAR(@)" +syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $VAR(@)"; + "Prefix doesn't fall on a natural boundry" -commit:expression: !($VAR(./backdoor/) != "" && $VAR(./route-map/) != ""); \ - "May specify route-map or backdoor but not both" +commit:expression: !($VAR(./backdoor/) != "" && $VAR(./route-map/) != ""); + "May specify route-map or backdoor but not both" -delete:expression: "touch /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID" +delete: touch /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID -end:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -noerr \ - -c \"configure terminal\" \ - -c \"router bgp $VAR(../@)\" \ - -c \"no network $VAR(@)\"; \ - if [ -f \"/tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID\" ]; then \ - rm -rf /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID; \ - else \ -# -# Commenting out until cli bug 2525 is fixed -# -# if [ -n \"$VAR(./backdoor/)\" ]; then -# COND=\"backdoor\"; -# fi; - if [ -n \"$VAR(./route-map/@)\" ]; then \ - COND=\"route-map $VAR(./route-map/@)\"; \ - fi; \ - ${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal\" \ - -c \"router bgp $VAR(../@)\" \ - -c \"network $VAR(@) $COND\"; \ - fi; " +end: ${vyatta_sbindir}/vyatta-vtysh.pl -noerr -c "configure terminal" -c "router bgp $VAR(../@)" -c "no network $VAR(@)"; + + if [ -f "/tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID" ]; then + rm -rf /tmp/`echo $VAR(@) | sed 's!/!!'`.$PPID; + else + # uncomment and replace the call to vyatta-check-typeless-node.pl pending bug 2525 + #if [ -n \"$VAR(./backdoor/)\" ]; then + # COND=\"backdoor\"; + #fi; + ${vyatta_sbindir}/vyatta-check-typeless-node.pl "protocols bgp $VAR(../@) network $VAR(@) backdoor"; + if [ $? -eq 0 ]; then + cond="backdoor "; + fi ; + + if [ -n "$VAR(./route-map/@)" ]; then + COND="route-map $VAR(./route-map/@)"; + fi; + + ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" -c "router bgp $VAR(../@)" -c "network $VAR(@) $cond"; + fi; diff --git a/templates/protocols/bgp/node.tag/network/node.tag/.backdoor/node.def b/templates/protocols/bgp/node.tag/network/node.tag/.backdoor/node.def deleted file mode 100644 index b7dc6950..00000000 --- a/templates/protocols/bgp/node.tag/network/node.tag/.backdoor/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Specify a BGP backdoor route diff --git a/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def b/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def new file mode 100644 index 00000000..b7dc6950 --- /dev/null +++ b/templates/protocols/bgp/node.tag/network/node.tag/backdoor/node.def @@ -0,0 +1 @@ +help: Specify a BGP backdoor route -- cgit v1.2.3