diff options
-rw-r--r-- | perl-install/network/ipsec.pm | 15 | ||||
-rw-r--r-- | perl-install/standalone/drakvpn | 11 |
2 files changed, 21 insertions, 5 deletions
diff --git a/perl-install/network/ipsec.pm b/perl-install/network/ipsec.pm index 3c17f0994..74ae42cd7 100644 --- a/perl-install/network/ipsec.pm +++ b/perl-install/network/ipsec.pm @@ -235,13 +235,18 @@ sub display_racoon_conf { my ($racoon) = @_; my $display = ""; my $prefix_to_simple_line = ""; + my $pt; foreach my $key1 (ikeys %$racoon) { if (!$racoon->{$key1}{1}) { $display .= $prefix_to_simple_line . $racoon->{$key1} . "\n"; $prefix_to_simple_line = ""; } else { foreach my $key2 (ikeys %{$racoon->{$key1}}) { - $key2 > 1 ? my $pt = $racoon->{$key1}{$key2-1}[0] : my $pt = $racoon->{$key1}{1}[0]; + if ($key2 > 1) { + $pt = $racoon->{$key1}{$key2-1}[0]; + } else { + $pt = $racoon->{$key1}{1}[0]; + }; my $t = $racoon->{$key1}{1}[0]; my $f = $racoon->{$key1}{$key2}[0]; my $list_length = scalar @{$racoon->{$key1}{$key2}}; @@ -297,13 +302,18 @@ sub write_racoon_conf { my ($racoon_conf, $racoon) = @_; my $display = ""; my $prefix_to_simple_line = ""; + my $pt; foreach my $key1 (ikeys %$racoon) { if (!$racoon->{$key1}{1}) { $display .= $prefix_to_simple_line . $racoon->{$key1} . "\n"; $prefix_to_simple_line = ""; } else { foreach my $key2 (ikeys %{$racoon->{$key1}}) { - $key2 > 1 ? my $pt = $racoon->{$key1}{$key2-1}[0] : my $pt = $racoon->{$key1}{1}[0]; + if ($key2 > 1) { + $pt = $racoon->{$key1}{$key2-1}[0]; + } else { + $pt = $racoon->{$key1}{1}[0]; + }; my $t = $racoon->{$key1}{1}[0]; my $f = $racoon->{$key1}{$key2}[0]; my $list_length = scalar @{$racoon->{$key1}{$key2}}; @@ -451,6 +461,7 @@ sub remove_section_racoon_conf { delete $racoon->{$k} if $k > 1 && !$racoon->{$k-1}; my $closing_curly_bracket = 0; while ($closing_curly_bracket < 2) { + print "-->$k\n"; $closing_curly_bracket++ if $racoon->{$k} eq "}"; delete $racoon->{$k}; $k++; diff --git a/perl-install/standalone/drakvpn b/perl-install/standalone/drakvpn index 5ff903fed..0f0192e40 100644 --- a/perl-install/standalone/drakvpn +++ b/perl-install/standalone/drakvpn @@ -333,7 +333,12 @@ my $existing_section = ""; step_display_ipsec_conf: if ($d eq "display $ipsec_conf" || $d eq "display") { - if (-e $ipsec_conf) { + my $ipsec_exists = 0; + foreach my $key (keys %$ipsec) { + $ipsec_exists = 1 if $ipsec->{$key}; + }; + + if ($ipsec_exists) { $in->ask_okcancel(N("Display configuration"), network::ipsec::display_ipsec_conf($ipsec_conf,$ipsec,$kernel_version)); goto step_configure_ipsec_conf; @@ -710,7 +715,7 @@ step_display_racoon_conf: if ($d eq "display") { my $racoon_exists = 0; - foreach my $key (keys %{$racoon}) { + foreach my $key (keys %$racoon) { $racoon_exists = 1 if $racoon->{$key}; }; @@ -948,7 +953,7 @@ $::Wizard_finished = 1; $in->ask_okcancel(N("Congratulations!"), N("Everything has been configured.\n You may now share ressources through the Internet, -in a secure way, using a VPN connection.\n +in a secure way, using a VPN connection. You should make sure that that the tunnels shorewall section is configured.")); |