summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2011-05-25 11:49:47 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2011-05-25 11:49:47 -0700
commitd7b033bb5576b497c84a73bfc8a852614f9821b9 (patch)
tree77d6b8873c9c71696808c4a4220eb4bf4311a4b5 /scripts
parent44a842e60437bd3912e5a4fd1fe35b196307efa7 (diff)
downloadvyatta-cfg-system-d7b033bb5576b497c84a73bfc8a852614f9821b9.tar.gz
vyatta-cfg-system-d7b033bb5576b497c84a73bfc8a852614f9821b9.zip
alternative fix for bug 6958
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-tunnel-cleanup8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/vyatta-tunnel-cleanup b/scripts/vyatta-tunnel-cleanup
index 6094818c..979fb7bd 100755
--- a/scripts/vyatta-tunnel-cleanup
+++ b/scripts/vyatta-tunnel-cleanup
@@ -15,13 +15,17 @@ my %encapsulation = (
'sit' => 'sit',
);
+# interface being deleted
+my $interface = $ARGV[0];
+
# Create map of encapsulations still in use
my $config = new Vyatta::Config;
$config->setLevel("interfaces tunnel");
my %tunnel;
-foreach my $tun ( $config->listNodes() ) {
- my $mode = $config->returnValue("$tun encapsulation");
+foreach my $tun ( $config->listEffectiveNodes() ) {
+ my $mode = $config->returnEffectiveValue("$tun encapsulation");
+ next if ($interface eq $tun); # don't count the one being deleted
$tunnel{$mode} = 1;
}