diff options
author | Eugeni Dodonov <eugeni@mandriva.org> | 2009-03-31 14:48:16 +0000 |
---|---|---|
committer | Eugeni Dodonov <eugeni@mandriva.org> | 2009-03-31 14:48:16 +0000 |
commit | 4f92863478e39595fd8d5afdd927426367b1ccc1 (patch) | |
tree | 145c7aec77cce1affa606556d8a179255491dcb5 /lib | |
parent | 7e2bcb106c9dcfc637842342bd8aa347bc5b9dae (diff) | |
download | drakx-net-4f92863478e39595fd8d5afdd927426367b1ccc1.tar drakx-net-4f92863478e39595fd8d5afdd927426367b1ccc1.tar.gz drakx-net-4f92863478e39595fd8d5afdd927426367b1ccc1.tar.bz2 drakx-net-4f92863478e39595fd8d5afdd927426367b1ccc1.tar.xz drakx-net-4f92863478e39595fd8d5afdd927426367b1ccc1.zip |
Checking for connection to be up during installation.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/network/connection.pm | 2 | ||||
-rw-r--r-- | lib/network/connection/isdn.pm | 2 | ||||
-rw-r--r-- | lib/network/connection/ppp.pm | 2 | ||||
-rw-r--r-- | lib/network/connection/xdsl.pm | 2 | ||||
-rw-r--r-- | lib/network/netconnect.pm | 11 |
5 files changed, 18 insertions, 1 deletions
diff --git a/lib/network/connection.pm b/lib/network/connection.pm index aa05ab6..d059558 100644 --- a/lib/network/connection.pm +++ b/lib/network/connection.pm @@ -99,6 +99,8 @@ sub get_interface { sub get_metric { 60 } +sub get_up_timeout { 10 } + sub get_status { my ($self) = @_; require network::tools; diff --git a/lib/network/connection/isdn.pm b/lib/network/connection/isdn.pm index e26d15c..1b8debc 100644 --- a/lib/network/connection/isdn.pm +++ b/lib/network/connection/isdn.pm @@ -15,6 +15,8 @@ sub get_devices { } sub get_metric { 30 } +sub get_up_timeout { 20 } + use network::connection::isdn::consts; use modules; use run_program; diff --git a/lib/network/connection/ppp.pm b/lib/network/connection/ppp.pm index 459f6cc..37fabb3 100644 --- a/lib/network/connection/ppp.pm +++ b/lib/network/connection/ppp.pm @@ -56,6 +56,8 @@ sub get_options { sub get_tty_device { "/dev/modem" } +sub get_up_timeout { 20 } + sub build_ifcfg_settings { my ($self) = @_; my $modemport = $self->get_tty_device; diff --git a/lib/network/connection/xdsl.pm b/lib/network/connection/xdsl.pm index 4352be7..e55dd24 100644 --- a/lib/network/connection/xdsl.pm +++ b/lib/network/connection/xdsl.pm @@ -24,6 +24,8 @@ sub get_devices() { sub get_metric { 25 } sub get_interface() { "ppp0" } +sub get_up_timeout { 20 } + my @non_ppp_protocols = qw(static dhcp); sub uses_ppp { my ($self) = @_; diff --git a/lib/network/netconnect.pm b/lib/network/netconnect.pm index 1e2a614..f344b34 100644 --- a/lib/network/netconnect.pm +++ b/lib/network/netconnect.pm @@ -311,7 +311,16 @@ If you do not know it, keep the preselected protocol.") }, $connection->connect; #- FIXME: should use network::test for ppp (after future merge with network::connection) #- or start interface synchronously - services::start('network-up') unless $::isInstall; + if (!$::isInstall) { + services::start('network-up'); + } else { + my $timeout = $connection->get_up_timeout; + while ($timeout--) { + my $status = $connection->get_status; + last if $status; + sleep 1; + } + } $success = $connection->get_status(); $has_internet = network::tools::connected(); } |