diff options
-rw-r--r-- | templates/protocols/static/route/node.tag/blackhole/node.def | 24 | ||||
-rw-r--r-- | templates/protocols/static/route/node.tag/next-hop/node.def | 8 |
2 files changed, 19 insertions, 13 deletions
diff --git a/templates/protocols/static/route/node.tag/blackhole/node.def b/templates/protocols/static/route/node.tag/blackhole/node.def index 930ecfa3..f3844833 100644 --- a/templates/protocols/static/route/node.tag/blackhole/node.def +++ b/templates/protocols/static/route/node.tag/blackhole/node.def @@ -1,11 +1,15 @@ help: Set to silently discard pkts when matched -delete:expression: "touch /tmp/static.$PPID" -end:expression: "if [ -f \"/tmp/static.$PPID\" ]; then \ - vyatta-vtysh -c \"configure terminal\" -c \"no ip route $VAR(../@) null0\" ; \ - rm /tmp/static.$PPID; \ - else \ - if [ -n \"$VAR(./distance/@)\" ]; then \ - DIST=\"$VAR(./distance/@)\"; \ - fi; \ - vyatta-vtysh -c \"configure terminal\" -c \"ip route $VAR(../@) null0 $DIST \" ; \ - fi; " + +delete: touch /tmp/static.$PPID + +end: if [ -f "/tmp/static.$PPID" ]; then + vyatta-vtysh -c "configure terminal" \ + -c "no ip route $VAR(../@) null0"; + rm /tmp/static.$PPID; + else + if [ -n "$VAR(./distance/@)" ]; then + DIST="$VAR(./distance/@)"; + fi; + vyatta-vtysh -c "configure terminal" \ + -c "ip route $VAR(../@) null0 $DIST"; + fi; diff --git a/templates/protocols/static/route/node.tag/next-hop/node.def b/templates/protocols/static/route/node.tag/next-hop/node.def index f93b1270..e631df83 100644 --- a/templates/protocols/static/route/node.tag/next-hop/node.def +++ b/templates/protocols/static/route/node.tag/next-hop/node.def @@ -5,9 +5,10 @@ delete: touch /tmp/static.$PPID end: if [[ -f /tmp/static.$PPID ]] then if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \ - "$VAR(../@)" "$VAR(@)" + "$VAR(../@)" "$VAR(@)" then - vyatta-vtysh -c "configure terminal" -c "no ip route $VAR(../@) $VAR(@)" + vyatta-vtysh -c "configure terminal" \ + -c "no ip route $VAR(../@) $VAR(@)" fi rm -f /tmp/static.$PPID else @@ -15,5 +16,6 @@ end: if [[ -f /tmp/static.$PPID ]] then DIST="$VAR(./distance/@)" fi - vyatta-vtysh -c "configure terminal" -c "ip route $VAR(../@) $VAR(@) $DIST" ; \ + vyatta-vtysh -c "configure terminal" \ + -c "ip route $VAR(../@) $VAR(@) $DIST"; fi |