From adac76270bbf32f3bf46ba9d790d4ac20fd2da9c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 15 Mar 2004 15:16:21 +0000 Subject: always write scripts like in the old days but when there's no cnx --- perl-install/network/netconnect.pm | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'perl-install/network/netconnect.pm') diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index c2142f20a..289169977 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -173,7 +173,7 @@ sub real_main { 3 => N("CHAP"), 4 => N("PAP/CHAP"), ); - + my $offer_to_connect = sub { return "ask_connect_now" if $netc->{internet_cnx_choice} eq 'adsl' && $adsl_devices{$ntf_name}; return "ask_connect_now" if member($netc->{internet_cnx_choice}, qw(modem isdn)); @@ -181,6 +181,15 @@ sub real_main { }; my $after_start_on_boot_step = sub { + if ($netc->{internet_cnx_choice}) { + write_cnx_script($netc); + $netcnx->{type} = $netc->{internet_cnx}{$netc->{internet_cnx_choice}}{type} if $netc->{internet_cnx_choice}; + write_initscript(); + } else { + undef $netc->{NET_DEVICE}; + } + network::network::configureNetwork2($in, $::prefix, $netc, $intf); + $network_configured = 1; return "restart" if $need_restart_network && $::isStandalone && !$::expert; return $offer_to_connect->(); }; @@ -1136,16 +1145,6 @@ N("Last but not least you can also type in your DNS server IP addresses."), post => sub { my ($res) = @_; $netc->{at_boot} = $res; - if ($res) { - write_cnx_script($netc); - $netcnx->{type} = $netc->{internet_cnx}{$netc->{internet_cnx_choice}}{type} if $netc->{internet_cnx_choice}; - write_initscript(); - } else { - undef $netc->{NET_DEVICE}; - } - - network::network::configureNetwork2($in, $::prefix, $netc, $intf); - $network_configured = 1; return $after_start_on_boot_step->(); }, }, -- cgit v1.2.1