From d4221b8a5b38333e57b2fd5f8c42b7316fc8df59 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 19 Oct 2014 18:00:46 +0200 Subject: Remove the VTI script after use. --- scripts/vyatta-vti-config.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts/vyatta-vti-config.pl') 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; -- cgit v1.2.3