diff options
-rw-r--r-- | templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def b/templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def index ad045d40..17979d4b 100644 --- a/templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def +++ b/templates/protocols/static/route/node.tag/next-hop/node.tag/next-hop-interface/node.def @@ -1,3 +1,16 @@ type: txt help: network interface allowed: sh -c "${vyos_completion_dir}/list_interfaces.py" +end: + if [[ ${COMMIT_ACTION} = 'DELETE' ]] + then + if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then + exit 1; + fi + if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \ + "$VAR(../../@)" "$VAR(../@)" + then + vtysh -c "configure terminal" \ + -c "no ip route $VAR(../../@) $VAR(../@) $VAR(@)" + fi + fi |