From 760876d8328880316720ebce2bdcc1b86372350c Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Fri, 11 Jul 2008 17:00:57 -0700 Subject: fix for bug 3044: hide perl error messages --- scripts/vpn-config.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/vpn-config.pl b/scripts/vpn-config.pl index 219c4fe..3a62a04 100755 --- a/scripts/vpn-config.pl +++ b/scripts/vpn-config.pl @@ -423,9 +423,10 @@ if ($vcVPN->exists('ipsec')) { . 'configured if local IP is 0.0.0.0.' . "\n"; $error = 1; - } - $genout .= "\tleft=%defaultroute\n"; - $genout .= "\tleftid=$authid\n"; + } else { + $genout .= "\tleft=%defaultroute\n"; + $genout .= "\tleftid=$authid\n"; + } } else { $genout .= "\tleft=$lip\n"; } @@ -705,7 +706,8 @@ if ($vcVPN->exists('ipsec')) { } else { $right = $peer; } - my $index1 = ($lip eq '0.0.0.0') ? "$authid" : $lip; + my $index1 = ($lip eq '0.0.0.0' && defined($authid)) + ? "$authid" : $lip; $genout_secrets .= "$index1 $right : PSK \"$psk\"\n"; $genout .= "\tauthby=secret\n"; } elsif (defined($auth_mode) && $auth_mode eq 'rsa') { -- cgit v1.2.3