From 5b516cbeb01c86707f2bbfe2bcab4b9eca6800be Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 22 Nov 2010 11:25:19 -0800 Subject: Optimize lookup of local ip on tunnels Speeds up boot with lots of tunnels --- templates/interfaces/tunnel/node.tag/local-ip/node.def | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/interfaces/tunnel/node.tag/local-ip/node.def b/templates/interfaces/tunnel/node.tag/local-ip/node.def index ea11f6e1..809c4c6f 100644 --- a/templates/interfaces/tunnel/node.tag/local-ip/node.def +++ b/templates/interfaces/tunnel/node.tag/local-ip/node.def @@ -2,9 +2,8 @@ type: ipv4 help: Local IP address for this tunnel [REQUIRED] syntax:expression: exec \ - "if [ -z \"`ip addr list | grep $VAR(@) `\" ]; then \ - echo Warning! IP address $VAR(@) doesn\\'t exist on this system ; \ - fi ; " + "/opt/vyatta/sbin/local_ip $VAR(@) || \ + echo Warning! IP address $VAR(@) doesn\\'t exist on this system" create:expression: "true" update:expression: "false" ; \ -- cgit v1.2.3