diff options
author | Daniil Baturin <daniil@baturin.org> | 2014-10-19 18:00:46 +0200 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2014-10-19 18:00:46 +0200 |
commit | d4221b8a5b38333e57b2fd5f8c42b7316fc8df59 (patch) | |
tree | a6514dad802ba4a9a2eddd98cf5872457dc47f1a /scripts/vyatta-vti-config.pl | |
parent | 8f276005e1e0fd61801b98e3e8e2bb90c15005c3 (diff) | |
download | vyatta-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-x | scripts/vyatta-vti-config.pl | 9 |
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; |