From 25f1f4f08086f42958eb2f8ff0a88494f6918457 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 26 Feb 2003 14:25:21 +0000 Subject: add probe of internet connection (this could avoid strange behaviour). --- perl-install/network/network.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'perl-install/network/network.pm') diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index ebb2fd505..c04cfcca6 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -456,8 +456,8 @@ sub proxy_configure { } sub read_all_conf { - my ($prefix, $netc, $intf) = @_; - $netc ||= {}; $intf ||= {}; + my ($prefix, $netc, $intf, $netcnx) = @_; + $netc ||= {}; $intf ||= {}; $netcnx ||= {}; add2hash($netc, read_conf("$prefix/etc/sysconfig/network")) if -r "$prefix/etc/sysconfig/network"; add2hash($netc, read_resolv_conf()); add2hash($netc, read_tmdns_conf("$prefix/etc/tmdns.conf")) if -r "$prefix/etc/tmdns.conf"; @@ -467,6 +467,14 @@ sub read_all_conf { add2hash($intf, { getVarsFromSh("$prefix/etc/sysconfig/network-scripts/$_") }); } } + #- try to probe $netcnx->{type} which is used almost everywhere. + unless ($netcnx->{type}) { + #- ugly hack to determine network type (avoid saying not configured in summary). + $intf->{eth0} and $netcnx->{type} ||= 'lan'; + $intf->{ppp0} and $netcnx->{type} ||= 'modem'; + -e "$prefix/etc/ppp/peers/adsl" and $netcnx->{type} ||= 'adsl'; # enough ? + -e "$prefix/etc/ppp/ioptions1B" || -e "$prefix/etc/ppp/ioptions2B" and $netcnx->{type} ||= 'isdn'; # enough ? + } } sub easy_dhcp { -- cgit v1.2.1