From 76df8018fe0f0648abc58bd7a988ffaf61e75106 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 3 Mar 2009 08:42:36 -0800 Subject: Use check option to vyatta-interfaces.pl Eliminate checks in template in favor of doing it in one place in vyatta-interfaces.pl code. --- templates/interfaces/loopback/node.def | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'templates/interfaces/loopback') diff --git a/templates/interfaces/loopback/node.def b/templates/interfaces/loopback/node.def index e57f4b1..690dc39 100644 --- a/templates/interfaces/loopback/node.def +++ b/templates/interfaces/loopback/node.def @@ -1,14 +1,7 @@ tag: type: txt help: Set loopback interface -allowed: echo "lo" -syntax:expression: exec "\ - if [ ! -d /sys/class/net/$VAR(@) ]; then \ - echo \"loopback interface $VAR(@) does not exist\"; \ - exit 1; \ - elif [ $(cat /sys/class/net/$VAR(@)/type) -ne 772 ]; then \ - echo \"interface $VAR(@) is not a loopback interface\"; \ - exit 1; \ - fi" - +syntax:expression: exec \ + "/opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(@) --check=loopback" +allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=loopback update: sudo ip link set $VAR(@) up -- cgit v1.2.3