diff options
author | Kim Hagen <kim.sidney@gmail.com> | 2017-04-30 20:44:59 +0200 |
---|---|---|
committer | Kim Hagen <kim.sidney@gmail.com> | 2017-04-30 20:44:59 +0200 |
commit | 888c927fc526b112da3b94d8edc73fa50a24988b (patch) | |
tree | 095fa3148f5bc6e855d643ed57e5cf61d6b00040 | |
parent | 41e4f093b62e220e4d791caef35483cd3223e465 (diff) | |
download | vyatta-cfg-quagga-888c927fc526b112da3b94d8edc73fa50a24988b.tar.gz vyatta-cfg-quagga-888c927fc526b112da3b94d8edc73fa50a24988b.zip |
T23: Unable to remove rule from prefix list
do not add config if command fails
-rw-r--r-- | templates/policy/prefix-list/node.tag/rule/node.def | 6 | ||||
-rw-r--r-- | templates/policy/prefix-list6/node.tag/rule/node.def | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/templates/policy/prefix-list/node.tag/rule/node.def b/templates/policy/prefix-list/node.tag/rule/node.def index 03692419..edc2db07 100644 --- a/templates/policy/prefix-list/node.tag/rule/node.def +++ b/templates/policy/prefix-list/node.tag/rule/node.def @@ -37,7 +37,9 @@ end: len=`echo $VAR(./prefix/@) | awk -F/ '{ print $2 }'` ; if [ -f "/tmp/protocols-$VAR(../@)-$VAR(@).$PPID" ]; then rm -f "protocols-$VAR(../@)-$VAR(@).$PPID" ; else - vtysh -c "configure terminal" \ - -c "ip prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $cond " ; + if ! vtysh -c "configure terminal" \ + -c "ip prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $cond " ; then + exit 1 ; + fi; fi ; exit 0 ; diff --git a/templates/policy/prefix-list6/node.tag/rule/node.def b/templates/policy/prefix-list6/node.tag/rule/node.def index 2f73ebc3..b5c2aed5 100644 --- a/templates/policy/prefix-list6/node.tag/rule/node.def +++ b/templates/policy/prefix-list6/node.tag/rule/node.def @@ -36,7 +36,9 @@ end: len=`echo $VAR(./prefix/@) | awk -F/ '{ print $2 }'` ; fi; if [ ${COMMIT_ACTION} = 'SET' -o ${COMMIT_ACTION} = 'ACTIVE' ]; then - vtysh -c "configure terminal" \ - -c "ipv6 prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $cond " ; + if ! vtysh -c "configure terminal" \ + -c "ipv6 prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $cond " ; then + exit 1 ; + fi; fi; exit 0 ; |