summaryrefslogtreecommitdiff
path: root/scripts/vyatta-vti-config.pl
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2014-10-19 18:00:46 +0200
committerDaniil Baturin <daniil@baturin.org>2014-10-19 18:00:46 +0200
commitd4221b8a5b38333e57b2fd5f8c42b7316fc8df59 (patch)
treea6514dad802ba4a9a2eddd98cf5872457dc47f1a /scripts/vyatta-vti-config.pl
parent8f276005e1e0fd61801b98e3e8e2bb90c15005c3 (diff)
downloadvyatta-cfg-vpn-d4221b8a5b38333e57b2fd5f8c42b7316fc8df59.tar.gz
vyatta-cfg-vpn-d4221b8a5b38333e57b2fd5f8c42b7316fc8df59.zip
Remove the VTI script after use.
Diffstat (limited to 'scripts/vyatta-vti-config.pl')
-rwxr-xr-xscripts/vyatta-vti-config.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/vyatta-vti-config.pl b/scripts/vyatta-vti-config.pl
index 2d3bcf9..aaec27a 100755
--- a/scripts/vyatta-vti-config.pl
+++ b/scripts/vyatta-vti-config.pl
@@ -298,14 +298,15 @@ sub cleanupVtiNotConfigured {
sub execGenCmds {
if ($gencmds ne "") {
- open my $output_config, '>', '/tmp/vti_config' or die "Can't open /tmp/vti_config $!";
+ my $vti_script = '/tmp/vti_config';
+ open my $output_config, '>', $vti_script or die "Can't open /tmp/vti_config $!";
print ${output_config} "#!/bin/sh\n";
print ${output_config} $gencmds;
close $output_config;
- `chmod 755 /tmp/vti_config`;
- system("/tmp/vti_config");
+ `chmod 755 $vti_script`;
+ system($vti_script);
$result = $? >> 8;
- #TODO: remove /tmp/vti_config;
+ unlink($vti_script);
return $result;
}
return 0;