From 0c2eb2db089577145f89f216db228c1472279d5f Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 12 Feb 2009 13:55:00 -0800 Subject: Fix ambiguous use of $log There were two definitions of $log --- scripts/vpn-config.pl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'scripts/vpn-config.pl') diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl index 4beba95..2dc7631 100755 --- a/scripts/vpn-config.pl +++ b/scripts/vpn-config.pl @@ -966,23 +966,23 @@ sub vpn_exec { return; } - open my $lo, '>>', "/tmp/ipsec.log" + open my $logf, '>>', "/tmp/ipsec.log" or die "Can't open /tmp/ipsec.log: $!"; use POSIX; my $timestamp = strftime("%Y-%m-%d %H:%M.%S", localtime); - print ${log} "$timestamp\nExecuting: $command\nDescription: $desc\n"; + print ${logf} "$timestamp\nExecuting: $command\nDescription: $desc\n"; if ($error == 0) { my $cmd_out = qx($command); my $rval = ($? >> 8); - print ${log} "Output:\n$cmd_out\n---\n"; - print ${log} "Return code: $rval\n"; + print ${logf} "Output:\n$cmd_out\n---\n"; + print ${logf} "Return code: $rval\n"; if ($rval) { if ($command =~ /^ipsec auto --asynchronous --up/ && ($rval == 104 || $rval == 29)) { - print ${log} "OK when bringing up VPN connection\n"; + print ${logf} "OK when bringing up VPN connection\n"; } else { # # We use to consider the commit failed if we got a error @@ -996,17 +996,17 @@ sub vpn_exec { # a script to /etc/ppp/ip-up.d to bring up the vpn # tunnel. # - print ${log} "VPN commit error. Unable to $desc, received error code $?\n"; + print ${logf} "VPN commit error. Unable to $desc, received error code $?\n"; print "Warning: unable to [$desc], received error code $?\n"; print "$cmd_out\n"; } } } else { - print ${log} "Execution not performed due to previous error.\n"; + print ${logf} "Execution not performed due to previous error.\n"; } - print ${log} "---\n\n"; - close $log; + print ${logf} "---\n\n"; + close $logf; } sub vpn_log { -- cgit v1.2.3