From ccc73a10bd4052342fa66b3853212aa3a9fc4c8f Mon Sep 17 00:00:00 2001 From: John Southworth Date: Fri, 17 Jun 2011 18:04:33 -0500 Subject: Missed two nodes in the last commit --- templates/protocols/static/route/node.tag/blackhole/node.def | 12 ++---------- .../protocols/static/route6/node.tag/blackhole/node.def | 12 ++---------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/templates/protocols/static/route/node.tag/blackhole/node.def b/templates/protocols/static/route/node.tag/blackhole/node.def index c72fabd2..95c96046 100644 --- a/templates/protocols/static/route/node.tag/blackhole/node.def +++ b/templates/protocols/static/route/node.tag/blackhole/node.def @@ -1,16 +1,8 @@ help: Silently discard pkts when matched end: if [ ${COMMIT_ACTION} = 'DELETE' ]; then - # Check that there is still a next-hop or blackhole if the parent is not deleted - ARR=( $(cli-shell-api listNodes protocols static route $VAR(../@) next-hop) ) - cli-shell-api exists protocols static route $VAR(../@) blackhole - RETVAL_BH=$? - cli-shell-api exists protocols static route $VAR(../@) - RETVAL_PARENT=$? - if [ ${#ARR} -eq 0 ] && [ $RETVAL_BH -eq 1 ] && [ $RETVAL_PARENT -eq 0 ] - then - echo "Must add either a next-hop or blackhole for route $VAR(../@)" - exit 1 + if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then + exit 1; fi vtysh -c "configure terminal" \ diff --git a/templates/protocols/static/route6/node.tag/blackhole/node.def b/templates/protocols/static/route6/node.tag/blackhole/node.def index c8e202b2..4344aa5a 100644 --- a/templates/protocols/static/route6/node.tag/blackhole/node.def +++ b/templates/protocols/static/route6/node.tag/blackhole/node.def @@ -1,16 +1,8 @@ help: Silently discard pkts when matched end: if [ ${COMMIT_ACTION} = 'DELETE' ]; then - # Check that there is still a next-hop or blackhole if the parent is not deleted - ARR=( $(cli-shell-api listNodes protocols static route6 $VAR(../@) next-hop) ) - cli-shell-api exists protocols static route6 $VAR(../@) blackhole - RETVAL_BH=$? - cli-shell-api exists protocols static route6 $VAR(../@) - RETVAL_PARENT=$? - if [ ${#ARR} -eq 0 ] && [ $RETVAL_BH -eq 1 ] && [ $RETVAL_PARENT -eq 0 ] - then - echo "Must add either a next-hop or blackhole for route $VAR(../@)" - exit 1 + if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv6 address; then + exit 1; fi vtysh -c "configure terminal" \ -- cgit v1.2.3