From d2998c466ae2631cf4890e1984849012c3d5e2c8 Mon Sep 17 00:00:00 2001 From: Damien Chaumette Date: Mon, 18 Aug 2003 14:52:11 +0000 Subject: - fix up/down interface detection - do not wipe out IP and NETMASK when "No ip" is filled in - fix typo --- perl-install/standalone/drakconnect | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'perl-install') diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect index 3a849f75a..298b67fc5 100755 --- a/perl-install/standalone/drakconnect +++ b/perl-install/standalone/drakconnect @@ -288,8 +288,7 @@ sub get_int_ip { local $_ = `LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /sbin/ifconfig $interface`; $ip = /inet addr:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/mso ? $1 : N("No Ip"); $mask = /Mask:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/mso ? $1 : N("No Mask"); - $_ = `LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /sbin/ifconfig`; - $state = /$interface/ ? "up" : "down"; + $state = /inet/ ? "up" : "down"; } else { $ip = $intf->{$interface}{IPADDR}; $state = "n/a"; @@ -328,7 +327,7 @@ sub apply() { $button_apply->set_sensitive(0); } -sub ethisup { `LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /sbin/ifconfig` =~ /eth$_[0]/ } +sub ethisup { `LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /sbin/ifconfig eth$_[0]` =~ /inet/ } my $to_update; sub update() { @@ -412,7 +411,7 @@ sub configure_hostname() { } sub get_intf_status { - my ($c) = @ç; + my ($c) = @_; ethisup($c) ? N("Deactivate now") : N("Activate now") } @@ -520,8 +519,10 @@ Configure them first by clicking on 'Configure'")),1,1,0); if ($intf->{"eth$_"}{BOOTPROTO} ne "static") { delete @{$intf->{"eth$_"}}{qw(IPADDR NETWORK NETMASK BROADCAST)}; } else { - $intf->{"eth$_"}{IPADDR} = $infos[1]->get_text; - $intf->{"eth$_"}{NETMASK} = $infos[3]->get_text; + if ($infos[1]->get_text ne "No ip") { + $intf->{"eth$_"}{IPADDR} = $infos[1]->get_text; + $intf->{"eth$_"}{NETMASK} = $infos[3]->get_text; + } } } update(); -- cgit v1.2.1