summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-06-17 23:59:04 +0100
committerJeff Leung <jleung@v10networks.ca>2015-12-05 04:28:14 -0500
commit013fd2ac5dc2cd426d85e850496bb826cb483109 (patch)
tree9e9b4f77280ee0d1c3b1350af8c91c474820252d
parent133cf61f7abee867dc6b7007c077254ec8ba1443 (diff)
downloadvyatta-cfg-vpn-013fd2ac5dc2cd426d85e850496bb826cb483109.tar.gz
vyatta-cfg-vpn-013fd2ac5dc2cd426d85e850496bb826cb483109.zip
vyatta-cfg-vpn: further tidy up of vyatta-vti-config.pl
Remove old comments and other minor tidying up / rearranging of scripts/vyatta-vti-config.pl
-rwxr-xr-xscripts/vyatta-vti-config.pl12
1 files changed, 2 insertions, 10 deletions
diff --git a/scripts/vyatta-vti-config.pl b/scripts/vyatta-vti-config.pl
index 758418a..980724c 100755
--- a/scripts/vyatta-vti-config.pl
+++ b/scripts/vyatta-vti-config.pl
@@ -36,6 +36,7 @@ use lib "/opt/vyatta/share/perl5";
use Getopt::Long;
use Vyatta::VPN::vtiIntf;
+use Vyatta::Config;
my $vti_cfg_err = "VPN VTI configuration error:";
my $gencmds = "";
@@ -57,12 +58,10 @@ GetOptions(
#
if ($updown ne '') {
if (!(defined $intfName) || $intfName eq '') {
-
# invalid
exit -1;
}
if (!(defined $action) || $action eq '') {
-
# invalid
exit -1;
}
@@ -76,7 +75,6 @@ if ($updown ne '') {
#
if ($checkref ne '') {
if (!(defined $intfName) || $intfName eq '') {
-
# invalid
exit -1;
}
@@ -84,16 +82,14 @@ if ($checkref ne '') {
exit $rval;
}
-###
+#
# Following code is to configure the vti.
#
-
vtiIntf::discoverVtiIntfs();
#
# Prepare Vyatta::Config object
#
-use Vyatta::Config;
my $vcIntf = new Vyatta::Config();
my $vcVPN = new Vyatta::Config();
$vcVPN->setLevel('vpn');
@@ -165,8 +161,6 @@ foreach my $peer (@peers) {
$mtu = 1500;
}
- #my $exists = `ls -l /sys/class/net/$tunName &> /dev/null`;
-
# description.
my $description = $vcIntf->returnValue("vti $tunName description");
@@ -227,7 +221,6 @@ exit $result;
#
sub vti_handle_updown {
my ($intfName, $action) = @_;
- use Vyatta::Config;
my $vcIntf = new Vyatta::Config();
$vcIntf->setLevel('interfaces');
my $disabled = $vcIntf->existsOrig("vti $intfName disabled");
@@ -238,7 +231,6 @@ sub vti_handle_updown {
sub vti_check_reference {
my ($intfName) = @_;
- use Vyatta::Config;
my $vcVPN = new Vyatta::Config();
$vcVPN->setLevel('vpn ipsec site-to-site');
my @peers = $vcVPN->listNodes('peer');