summaryrefslogtreecommitdiff
path: root/templates/interfaces/vti/node.def
diff options
context:
space:
mode:
Diffstat (limited to 'templates/interfaces/vti/node.def')
-rw-r--r--templates/interfaces/vti/node.def10
1 files changed, 10 insertions, 0 deletions
diff --git a/templates/interfaces/vti/node.def b/templates/interfaces/vti/node.def
index 0d9c422d..9a5120a6 100644
--- a/templates/interfaces/vti/node.def
+++ b/templates/interfaces/vti/node.def
@@ -6,6 +6,16 @@ val_help: <vtiN>; Virtual Tunnel interface name
syntax:expression: pattern $VAR(@) "^vti[0-9]+$" \
; "vti must be (vti-vti999)"
+begin:
+if [ "${COMMIT_ACTION}" == DELETE ]; then
+ # check if there is still a reference
+ `${vyatta_sbindir}/vyatta-vti-config.pl --checkref --intf=$VAR(@)`
+ if [ $? -gt 0 ] ; then
+ echo "Interface $VAR(@) is referenced in vpn configuration."
+ exit -1
+ fi
+fi
+
delete:
if [ -d /sys/class/net/$VAR(@) ] ; then
ip link set $VAR(@) down