summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorSaurabh Mohan <saurabh.mohan@vyatta.com>2012-06-11 17:48:26 -0700
committerSaurabh Mohan <saurabh.mohan@vyatta.com>2012-06-11 17:48:26 -0700
commit81b1b1fd957571f74cd38f38fa1496d2d8f047bc (patch)
tree3b03f5e89cdf83439db02d9f959daff6ad91b4fb /templates
parent60378d4a5f0de1d9140d6f6ab18c642049d5a939 (diff)
downloadvyatta-cfg-system-81b1b1fd957571f74cd38f38fa1496d2d8f047bc.tar.gz
vyatta-cfg-system-81b1b1fd957571f74cd38f38fa1496d2d8f047bc.zip
VTI delete check for reference under vpn.
Diffstat (limited to 'templates')
-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