summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Chaumette <dchaumette@mandriva.com>2003-08-18 14:52:11 +0000
committerDamien Chaumette <dchaumette@mandriva.com>2003-08-18 14:52:11 +0000
commitd2998c466ae2631cf4890e1984849012c3d5e2c8 (patch)
treebd0fe6dab5ca77de5347dea8ca43e91516860bfe
parent8f2c9c2d67ad2f613dad47eeb09e22866cbeca7f (diff)
downloaddrakx-backup-do-not-use-d2998c466ae2631cf4890e1984849012c3d5e2c8.tar
drakx-backup-do-not-use-d2998c466ae2631cf4890e1984849012c3d5e2c8.tar.gz
drakx-backup-do-not-use-d2998c466ae2631cf4890e1984849012c3d5e2c8.tar.bz2
drakx-backup-do-not-use-d2998c466ae2631cf4890e1984849012c3d5e2c8.tar.xz
drakx-backup-do-not-use-d2998c466ae2631cf4890e1984849012c3d5e2c8.zip
- fix up/down interface detection
- do not wipe out IP and NETMASK when "No ip" is filled in - fix typo
-rwxr-xr-xperl-install/standalone/drakconnect13
1 files changed, 7 insertions, 6 deletions
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();