summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakconnect
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-05-22 17:44:49 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-05-22 17:44:49 +0000
commitf5e1b639cb4407c09b01a10f0a5a48261bb95a6c (patch)
treed1391ad10160c4e3b943a2dd3de8226a770f5862 /perl-install/standalone/drakconnect
parent85e90a38fe5dbd0b88e7a8254c29e55714b34fa3 (diff)
downloaddrakx-f5e1b639cb4407c09b01a10f0a5a48261bb95a6c.tar
drakx-f5e1b639cb4407c09b01a10f0a5a48261bb95a6c.tar.gz
drakx-f5e1b639cb4407c09b01a10f0a5a48261bb95a6c.tar.bz2
drakx-f5e1b639cb4407c09b01a10f0a5a48261bb95a6c.tar.xz
drakx-f5e1b639cb4407c09b01a10f0a5a48261bb95a6c.zip
(build_list) simplify ip parsing
Diffstat (limited to 'perl-install/standalone/drakconnect')
-rwxr-xr-xperl-install/standalone/drakconnect4
1 files changed, 1 insertions, 3 deletions
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index e0f0d7d75..8381bf2a3 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -169,8 +169,6 @@ my $list = Gtk2::TreeView->new_with_model($tree_model);
$list->append_column(Gtk2::TreeViewColumn->new_with_attributes(undef, Gtk2::CellRendererPixbuf->new, 'pixbuf' => 0));
each_index { $list->append_column(Gtk2::TreeViewColumn->new_with_attributes($_, Gtk2::CellRendererText->new, 'text' => $::i + 1)) } (N("Interface"), N("IP address"), N("Protocol"), N("Driver"), N("State"));
-my $ip_regexp = qr/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/;
-
build_list();
my $button_lan = gtksignal_connect(Gtk2::Button->new(N("Configure Local Area Network...")),
@@ -294,7 +292,7 @@ sub build_list() {
my ($ip, $state);
if (-x "/sbin/ifconfig") {
local $_ = `LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /sbin/ifconfig "eth$i"`;
- $ip = /inet addr\:$ip_regexp/ ? "$1.$2.$3.$4" : N("Bad Ip");
+ $ip = /inet addr:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/o ? $1 : N("Bad Ip");
$_ = `LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /sbin/ifconfig`;
$state = /eth$i/ ? "up" : "down";
} else {