summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/net_monitor
diff options
context:
space:
mode:
authordamien <damien@mandriva.com>2002-01-09 19:55:21 +0000
committerdamien <damien@mandriva.com>2002-01-09 19:55:21 +0000
commit26f364d6608223588dfcc70e12d6a42c27db11a3 (patch)
tree85360082145755feae4accf6e677bc028fefce92 /perl-install/standalone/net_monitor
parent03d8c4da420bab98dfe07f0afcaada03bfecf848 (diff)
downloaddrakx-26f364d6608223588dfcc70e12d6a42c27db11a3.tar
drakx-26f364d6608223588dfcc70e12d6a42c27db11a3.tar.gz
drakx-26f364d6608223588dfcc70e12d6a42c27db11a3.tar.bz2
drakx-26f364d6608223588dfcc70e12d6a42c27db11a3.tar.xz
drakx-26f364d6608223588dfcc70e12d6a42c27db11a3.zip
big merge from update 8.1 with cvs
First part. Part 2 following
Diffstat (limited to 'perl-install/standalone/net_monitor')
-rwxr-xr-xperl-install/standalone/net_monitor31
1 files changed, 25 insertions, 6 deletions
diff --git a/perl-install/standalone/net_monitor b/perl-install/standalone/net_monitor
index 2c503a860..70504ed6e 100755
--- a/perl-install/standalone/net_monitor
+++ b/perl-install/standalone/net_monitor
@@ -413,12 +413,24 @@ sub update {
}
@interfaces = @intfs;
my $netc={};
- if ($isconnected != -1 && !$during_connection) {
- $button_connect->set_sensitive(1);
- $label_c->set($isconnected ? _("Disconnect") : _("Connect"));
- $statusbar->pop(1);
- $statusbar->push(1, $isconnected ? _("Connected") : _("Not connected"));
- $isconnected ? $pix_c->set($pix_c_map, $pix_c_mask) : $pix_c->set($pix_d_map, $pix_d_mask);
+ my $tmp;
+ connected_bg(\$tmp);
+ if(defined $tmp) {
+ $isconnected = $tmp;
+ if ($isconnected != -1 && !$during_connection) {
+ if($isconnected && !in_ifconfig($netcnx->{NET_INTERFACE})) {
+ $isconnected=0;
+ $statusbar->pop(1);
+ $statusbar->push(1, _("Warning, another internet connexion has been detected, maybe using your network"));
+ } else {
+ #- translators : $netcnx->{type} is the type of network connection (modem, adsl...)
+ $statusbar->pop(1);
+ $statusbar->push(1, $isconnected ? _("Connected") : _("Not connected"));
+ }
+ $label_c->set($isconnected ? _("Disconnect %s", $netcnx->{type}) : _("Connect %s", $netcnx->{type}));
+ $isconnected ? $pix_c->set($pix_c_map, $pix_c_mask) : $pix_c->set($pix_d_map, $pix_d_mask);
+ $button_connect->set_sensitive(1);
+ }
}
if (!(-e $connect_file && -e $disconnect_file)) {
$button_connect->set_sensitive(0);
@@ -427,6 +439,13 @@ sub update {
1;
}
+sub in_ifconfig {
+ my ($intf) = @_;
+ -e '/sbin/ifconfig' or return 1;
+ $intf eq '' and return 1;
+ `/sbin/ifconfig` =~ /$intf/;
+}
+
sub draw_monitor {
my ($o) = @_;
defined $o->{darea} or return;