From 3d515e3cc128a6cd47c399ff01f49f733e3eafbd Mon Sep 17 00:00:00 2001 From: upa Date: Tue, 26 Aug 2014 15:13:51 +0900 Subject: fix create/del error handling --- templates/interfaces/vxlan/node.def | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/interfaces/vxlan/node.def b/templates/interfaces/vxlan/node.def index f5f99af7..f7c9b7c7 100644 --- a/templates/interfaces/vxlan/node.def +++ b/templates/interfaces/vxlan/node.def @@ -17,6 +17,7 @@ begin: create: if [ -e /sys/class/net/$VAR(@) ]; then echo "VXLAN interface \"$VAR(@)\" already exists." + exit 1 fi VXLAN_VNI="id $VAR(./vni/@)" @@ -37,10 +38,10 @@ create: delete: if [ ! -e /sys/class/net/$VAR(@) ]; then echo "VXLAN interface \"$VAR(@)\" does not exist." + else + ip link del dev $VAR(@) fi - ip link del dev $VAR(@) - end: if [ -e /tmp/vxlan-$VAR(@)-create ]; then -- cgit v1.2.3