From bdd9640e07024fc400b7127053f1753aff7677b1 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 12 Feb 2004 15:02:11 +0000 Subject: fix step linking with ask_connect_now and restart steps: - fix check for restart step - only offer to connect now for ppp connections --- perl-install/network/netconnect.pm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 4ae9924f9..8c7ae8e1f 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -151,6 +151,12 @@ sub get_subwizard { $module = $dev->[1]; } else { $module = "" } }; + + 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)); + return "end"; + }; my %adsl_devices = ( speedtouch => N("Alcatel speedtouch USB modem"), @@ -1065,14 +1071,14 @@ You may also enter the IP address of the gateway if you have one."), network::network::configureNetwork2($in, $::prefix, $netc, $intf); $network_configured = 1; - $::isInstall ? "restart" : "ask_connect_now"; + return "restart" if $netconnect::need_restart_network && $::isStandalone && !$::expert; + return $offer_to_connect->(); }, }, restart => { - # FIXME: condition is "if ($netconnect::need_restart_network && $::isStandalone && (!$::expert || $in->ask_yesorno(..." - name => N("The network needs to be restarted. Do you want to restart it ?"), + name => N("The network needs to be restarted. Do you want to restart it ?"), # data => [ { label => N("Connection:"), val => \$type, type => 'list', list => [ sort values %l ] }, ], post => sub { if (!$::testing && !run_program::rooted($::prefix, "/etc/rc.d/init.d/network restart")) { @@ -1081,7 +1087,7 @@ You may also enter the IP address of the gateway if you have one."), N("A problem occured while restarting the network: \n\n%s", `/etc/rc.d/init.d/network restart`), 0); } write_initscript(); - return $::isStandalone && member($netc->{internet_cnx_choice}, qw(modem adsl isdn)) ? "ask_connect_now" : "end"; + return $offer_to_connect->(); }, }, -- cgit v1.2.1