summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/protocols/static/route/node.tag/blackhole/node.def12
-rw-r--r--templates/protocols/static/route6/node.tag/blackhole/node.def12
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" \