summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJohn Southworth <john.southworth@vyatta.com>2011-02-07 12:33:57 -0600
committerJohn Southworth <john.southworth@vyatta.com>2011-02-07 12:33:57 -0600
commit9f24f11add42a991fad3892b9bbb9aea999a8ac7 (patch)
tree01632f374e0863283846d6d7c9032461ef3b1ccf /lib
parentdc69c35534fbb13efca3eba6761655e3e9b3d75e (diff)
downloadvyatta-op-vpn-9f24f11add42a991fad3892b9bbb9aea999a8ac7.tar.gz
vyatta-op-vpn-9f24f11add42a991fad3892b9bbb9aea999a8ac7.zip
Fix filehandlers to conform to perl style guidelines
Diffstat (limited to 'lib')
-rw-r--r--lib/OPMode.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/OPMode.pm b/lib/OPMode.pm
index 6d75afe..64e7c85 100644
--- a/lib/OPMode.pm
+++ b/lib/OPMode.pm
@@ -97,10 +97,10 @@ sub nat_detect {
}
sub get_tunnel_info {
- my $cmd = "sudo ipsec statusall |";
- open(IPSECSTATUS, $cmd);
+ my $cmd = "sudo ipsec statusall";
+ open(my $IPSECSTATUS, ,'-|', $cmd);
my @ipsecstatus = [];
- while(<IPSECSTATUS>){
+ while(<$IPSECSTATUS>){
push (@ipsecstatus, $_);
}
my %tunnel_hash = ();
@@ -295,10 +295,10 @@ sub get_tunnel_info {
}
sub get_conns
{
- my $cmd = "sudo cat /etc/ipsec.conf |";
- open(IPSECCONF, $cmd);
+ my $cmd = "sudo cat /etc/ipsec.conf";
+ open(my $IPSECCONF, '-|', $cmd);
my @ipsecconf = [];
- while(<IPSECCONF>){
+ while(<$IPSECCONF>){
push (@ipsecconf, $_);
}
my %th = ();
@@ -530,9 +530,9 @@ sub show_ike_secrets
unless ( -r $secret_file) {
die "No secrets file $secret_file\n";
}
- open(DAT, $secret_file);
- my @raw_data=<DAT>;
- close(DAT);
+ open(my $DAT, '<', $secret_file);
+ my @raw_data=<$DAT>;
+ close($DAT);
foreach my $line (@raw_data) {
if ($line =~ /PSK/) {
my ($lip, $pip, $lid, $pid, $secret) = ('', '', 'N/A', 'N/A', '');