From ccc86da96be587935f616ce5ce8715c67f6d2f87 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Wed, 12 Dec 2007 20:12:56 -0800 Subject: Add wrapper script between cfg templates and vtysh. The wrapper will: - log commands to /tmp/vtysh.log - return error code when quagga responds with an errmsg - ignore errors when called with -n --- .../protocols/static/interface-route/node.tag/blackhole/node.def | 4 ++-- .../static/interface-route/node.tag/next-hop-interface/node.def | 4 ++-- templates/protocols/static/route/node.tag/blackhole/node.def | 4 ++-- templates/protocols/static/route/node.tag/next-hop/node.def | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'templates/protocols/static') diff --git a/templates/protocols/static/interface-route/node.tag/blackhole/node.def b/templates/protocols/static/interface-route/node.tag/blackhole/node.def index c1a8cc2c..5bfab1a8 100644 --- a/templates/protocols/static/interface-route/node.tag/blackhole/node.def +++ b/templates/protocols/static/interface-route/node.tag/blackhole/node.def @@ -1,11 +1,11 @@ help: "Silently discard pkts when matched" delete: "touch /tmp/static.\\$PPID" end: "if [ -f \"/tmp/static.\\$PPID\" ]; then \ - /usr/bin/vtysh -c \"configure terminal\" -c \"no ip route $(../@) null0\" ; \ + \\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"no ip route $(../@) null0\" ; \ rm /tmp/static.\\$PPID; \ else \ if [ -n \"$(./distance/@)\" ]; then \ DIST=\"$(./distance/@)\"; \ fi; \ - /usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) null0 \\$DIST \" ; \ + \\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"ip route $(../@) null0 \\$DIST \" ; \ fi; " diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def index 3c80ccec..f39457b7 100644 --- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def +++ b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def @@ -8,12 +8,12 @@ syntax: exec " \ fi ; " delete: "touch /tmp/static.\\$PPID" end: "if [ -f \"/tmp/static.\\$PPID\" ]; then \ - /usr/bin/vtysh -c \"configure terminal\" -c \"no ip route $(../@) $(@)\" ; \ + \\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"no ip route $(../@) $(@)\" ; \ rm /tmp/static.\\$PPID; \ else \ if [ -n \"$(./distance/@)\" ]; then \ DIST=\"$(./distance/@)\"; \ fi; \ - /usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) $(@) \\$DIST \" ; \ + \\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"ip route $(../@) $(@) \\$DIST \" ; \ fi; " diff --git a/templates/protocols/static/route/node.tag/blackhole/node.def b/templates/protocols/static/route/node.tag/blackhole/node.def index c1a8cc2c..5bfab1a8 100644 --- a/templates/protocols/static/route/node.tag/blackhole/node.def +++ b/templates/protocols/static/route/node.tag/blackhole/node.def @@ -1,11 +1,11 @@ help: "Silently discard pkts when matched" delete: "touch /tmp/static.\\$PPID" end: "if [ -f \"/tmp/static.\\$PPID\" ]; then \ - /usr/bin/vtysh -c \"configure terminal\" -c \"no ip route $(../@) null0\" ; \ + \\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"no ip route $(../@) null0\" ; \ rm /tmp/static.\\$PPID; \ else \ if [ -n \"$(./distance/@)\" ]; then \ DIST=\"$(./distance/@)\"; \ fi; \ - /usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) null0 \\$DIST \" ; \ + \\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"ip route $(../@) 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 6d9288cf..7d02f9d6 100644 --- a/templates/protocols/static/route/node.tag/next-hop/node.def +++ b/templates/protocols/static/route/node.tag/next-hop/node.def @@ -3,11 +3,11 @@ type: ipv4 help: "Configure the next-hop router" delete: "touch /tmp/static.\\$PPID" end: "if [ -f \"/tmp/static.\\$PPID\" ]; then \ - /usr/bin/vtysh -c \"configure terminal\" -c \"no ip route $(../@) $(@)\" ; \ + \\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"no ip route $(../@) $(@)\" ; \ rm /tmp/static.\\$PPID; \ else \ if [ -n \"$(./distance/@)\" ]; then \ DIST=\"$(./distance/@)\"; \ fi; \ - /usr/bin/vtysh -c \"configure terminal\" -c \"ip route $(../@) $(@) \\$DIST \" ; \ + \\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" -c \"ip route $(../@) $(@) \\$DIST \" ; \ fi; " -- cgit v1.2.3