summaryrefslogtreecommitdiffstats
path: root/perl-install
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
parent03d8c4da420bab98dfe07f0afcaada03bfecf848 (diff)
downloaddrakx-backup-do-not-use-26f364d6608223588dfcc70e12d6a42c27db11a3.tar
drakx-backup-do-not-use-26f364d6608223588dfcc70e12d6a42c27db11a3.tar.gz
drakx-backup-do-not-use-26f364d6608223588dfcc70e12d6a42c27db11a3.tar.bz2
drakx-backup-do-not-use-26f364d6608223588dfcc70e12d6a42c27db11a3.tar.xz
drakx-backup-do-not-use-26f364d6608223588dfcc70e12d6a42c27db11a3.zip
big merge from update 8.1 with cvs
First part. Part 2 following
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/adsl.pm3
-rw-r--r--perl-install/network/modem.pm4
-rw-r--r--perl-install/network/netconnect.pm3
-rw-r--r--perl-install/network/network.pm13
-rwxr-xr-xperl-install/standalone/draknet105
-rwxr-xr-xperl-install/standalone/net_monitor31
6 files changed, 95 insertions, 64 deletions
diff --git a/perl-install/network/adsl.pm b/perl-install/network/adsl.pm
index cb761dff4..b98744e60 100644
--- a/perl-install/network/adsl.pm
+++ b/perl-install/network/adsl.pm
@@ -170,7 +170,8 @@ LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /usr/sbin/adsl-start $netc->{NET_DEVICE
/usr/bin/killall pppoe pppd
', $netc->{adsltype}) } elsif ($adsl_type eq 'speedtouch') {
write_cnx_script($netc, 'adsl',
-'/usr/share/speedtouch/speedtouch.sh start
+'/sbin/route del default
+/usr/share/speedtouch/speedtouch.sh start
',
'/usr/share/speedtouch/speedtouch.sh stop
', $netc->{adsltype}) }
diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm
index 6fb48ae78..046ebbf8d 100644
--- a/perl-install/network/modem.pm
+++ b/perl-install/network/modem.pm
@@ -20,7 +20,9 @@ sub configure{
modem_step_1:
pppConfig($netcnx->{$netcnx->{type}}, $mouse, $netc) or return;
write_cnx_script($netc, "modem",
-q(ifup ppp0
+q(
+/sbin/route del default
+ifup ppp0
),
q(ifdown ppp0
killall pppd
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index 22baf92b7..3e0029cf5 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -224,7 +224,7 @@ ifdown eth0
} elsif ($nb == 1) {
$netc->{internet_cnx_choice} = (keys %{$netc->{internet_cnx}})[0];
}
- member($netc->{internet_cnx_choice}, ('modem', 'adsl', 'isdn')) and
+ member($netc->{internet_cnx_choice}, ('adsl', 'isdn')) and
$netc->{at_boot} = $in->ask_yesorno(_("Network Configuration Wizard"), _("Do you want to start the connection at boot?"));
if ($netc->{internet_cnx_choice} ) {
write_cnx_script($netc);
@@ -274,6 +274,7 @@ environnement to avoid hostname changing problem."));
#!/bin/bash
if [ -n "\$DISPLAY" ]; then
if [ -e /usr/bin/kppp ]; then
+/sbin/route del default
/usr/bin/kppp &
else
/usr/sbin/net_monitor --connect
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 80f9e41b2..933ef2215 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -261,8 +261,12 @@ sub gateway {
sub configureNetworkIntf {
my ($netc, $in, $intf, $net_device, $skip, $module) = @_;
my $text;
- my @wireless_modules = ("airo_cs", "netwave_cs", "ray_cs", "wavelan_cs", "wvlan_cs");
- if (member($module, @wireless_modules)) {
+ my @wireless_modules = ("airo_cs", "netwave_cs", "ray_cs", "wavelan_cs", "wvlan_cs", "airport");
+ my $flag = 0;
+ foreach (@wireless_modules) {
+ $module =~ /$_/ and $flag =1;
+ }
+ if ($flag) {
$intf->{wireless_eth} = 1;
$netc->{wireless_eth} = 1;
$intf->{WIRELESS_MODE} = "Managed";
@@ -344,7 +348,8 @@ sub configureNetworkNet {
my ($in, $netc, $intf, @devices) = @_;
$netc->{dnsServer} ||= dns($intf->{IPADDR});
- $netc->{GATEWAY} ||= gateway($intf->{IPADDR});
+ my $gateway_ex = gateway($intf->{IPADDR});
+#- $netc->{GATEWAY} ||= gateway($intf->{IPADDR});
$::isInstall and $in->set_help('configureNetworkHost');
$in->ask_from(_("Configuring network"),
@@ -354,7 +359,7 @@ such as ``mybox.mylab.myco.com''.
You may also enter the IP address of the gateway if you have one"),
[ { label => _("Host name"), val => \$netc->{HOSTNAME} },
{ label => _("DNS server"), val => \$netc->{dnsServer} },
- { label => _("Gateway"), val => \$netc->{GATEWAY} },
+ { label => _("Gateway (e.g. %s)", $gateway_ex), val => \$netc->{GATEWAY} },
if_(@devices > 1,
{ label => _("Gateway device"), val => \$netc->{GATEWAYDEV}, list => \@devices },
),
diff --git a/perl-install/standalone/draknet b/perl-install/standalone/draknet
index 33577f62e..ec0f35d07 100755
--- a/perl-install/standalone/draknet
+++ b/perl-install/standalone/draknet
@@ -185,59 +185,32 @@ $table1->attach($label5, 0, 1, 1, 2, 'fill', 'fill',0,0);
my $label6 = new Gtk::Label($netcnx->{type} eq 'lan' ? $netc->{GATEWAY} : $netcnx->{NET_INTERFACE});
$table1->attach($label6, 1, 2, 1, 2, 'fill', 'fill',0,0);
my $isconnected = -1;
-sub connected_local {
- print "in connected local\n";
- my $w = $in->wait_message('', _("Testing your connection..."), 1);
- Gtk->main_iteration while Gtk->events_pending;
- $isconnected=connected();
-}
+#-sub connected_local {
+#- print "in connected local\n";
+#- my $w = $in->wait_message('', _("Testing your connection..."), 1);
+#- Gtk->main_iteration while Gtk->events_pending;
+#- $isconnected=connected();
+#-}
my $label7 = new Gtk::Label(_("Status:"));
$table1->attach($label7, 0, 1, 2, 3, 'fill', 'fill',0,0);
my $label8 = new Gtk::Label(_("Testing your connection..."));
$table1->attach($label8, 1, 2, 2, 3, 'fill', 'fill',0,0);
+my $warning_label1 = new Gtk::Label("");
+$vbox_frame1->pack_start($warning_label1,0,0,0);
my $button2 = new Gtk::Button(_("Wait please"));
$button2->set_sensitive(0);
-$button2->signal_connect (clicked => sub {
- my $dialog = new Gtk::Dialog();
- $dialog->signal_connect ( delete_event => sub { Gtk->main_quit(); });
- $dialog->set_position(1);
- $dialog->vbox->set_border_width(10);
- $dialog->signal_connect ( delete_event => sub { Gtk->main_quit(); });
- $dialog->vbox->pack_start(my $l = new Gtk::Label(""),1,1,0);
- my $bbox_dialog = new Gtk::HButtonBox;
- $dialog->action_area->add($bbox_dialog);
- $bbox_dialog->set_layout(-end);
- my $button_ok = new Gtk::Button _("OK");
- $button_ok->signal_connect ( clicked => sub { Gtk->main_quit(); });
- $button_ok->set_sensitive(0);
- $bbox_dialog->add($button_ok );
- $dialog->show_all;
- $dialog->set_modal(1);
- if (!$isconnected) {
- $l->set(_("Starting your connection..."));
- Gtk->main_iteration while Gtk->events_pending;
- connect_backend();
- foreach (1..10) { Gtk->main_iteration while Gtk->events_pending; sleep 1; }
- my $up=connected_local();
- $l->set($up ? _("The system is now connected to Internet.") : _("The system doesn't seem to be connected to internet.
-Try to reconfigure your connection."));
- } else {
- $l->set(_("Closing your connection..."));
- Gtk->main_iteration while Gtk->events_pending;
- disconnect_backend();
- foreach (1..10) { Gtk->main_iteration while Gtk->events_pending; sleep 1; }
- my $up=connected_local();
- $l->set($up ? _("The connection is not closed.
-Try to do it manually by running
-/etc/sysconfig/network-scripts/net_cnx_down
-in root.") : _("The system is now disconnected.") );
- }
- $button_ok->set_sensitive(1);
- Gtk->main();
- $dialog->destroy;
- update2();
- });
+$button2->signal_connect(clicked => sub {
+ if (!$isconnected && cat_($connect_prog) =~ m|/usr/bin/kppp| && -e '/usr/bin/kppp') {
+ run_program::rooted($prefix, "/usr/bin/kppp &");
+ } elsif (!$isconnected) {
+ connect_backend();
+ } else {
+ disconnect_backend();
+ }
+ update2();
+ });
+
$table1->attach($button2, 2, 3, 2, 3, 'fill', 'fill',0,0);
#$table1->attach($button1, 2, 3, 1, 2, 'fill', 'fill',0,0);
@@ -393,6 +366,7 @@ sub apply {
sub ethisup { `LC_ALL=C LANG=C LANGUAGE=C LC_MESSAGES=C /sbin/ifconfig` =~ /eth$_[0]/ }
+my $to_update;
sub update {
my $h = chomp_(`hostname`);
$label_host->set ($h);
@@ -411,11 +385,32 @@ sub update {
1;
}
+sub in_ifconfig {
+ my ($intf) = @_;
+ -e '/sbin/ifconfig' or return 1;
+ $intf eq '' and return 1;
+ `/sbin/ifconfig` =~ /$intf/;
+}
+
sub update2 {
- connected_bg(\$isconnected);
+ undef $to_update;
+ connected_bg(\$to_update);
+ if (defined $to_update) {
+ $isconnected = $to_update;
+ if($isconnected !=-1) {
+ if ($isconnected && !in_ifconfig($netcnx->{NET_INTERFACE})) {
+ $warning_label1->set(_("Warning, another internet connexion has been detected, maybe using your network"));
+ $isconnected=0;
+ } else { $warning_label1->set("") }
+ $label8->set($isconnected ? _("Connected") : _("Not connected"));
+ $button2->child->set($isconnected ? _("Disconnect...") : _("Connect..."));
+ $button2->set_sensitive(1);
+ }
+ }
update();
1;
}
+
sub quit_global {
$::isEmbedded ? kill(USR1, $::CCPID) : Gtk->exit(0);
}
@@ -495,11 +490,19 @@ Configure them first by clicking on 'Configure'")),1,1,0);
$i++;
}
my $c = $_;
+ my $widget_temp;
+ if (-e "$prefix/etc/sysconfig/network-scripts/ifcfg-eth$c") {
+ $widget_temp = gtksignal_connect(new Gtk::Button(ethisup($c) ? _("desactivate now") : _("activate now")),
+ clicked => sub {
+ system("/sbin/if".(ethisup($c)?"down":"up")." eth$c");
+ gtkbuttonset($_[0], ethisup($c)?_("desactivate now"):_("activate now"));
+ });
+ } else {
+ $widget_temp = _("This interface has not been configured yet.\nLaunch the configuration wizard in the main window");
+ }
$vbox_local->pack_start(gtkpack__(new Gtk::HBox(0,0),
- gtksignal_connect(my $b = new Gtk::Button(ethisup($c) ? _("desactivate now") : _("activate now")), clicked => sub {
- system("/sbin/if".(ethisup($c)?"down":"up")." eth$c");
- gtkbuttonset($_[0], ethisup($c)?_("desactivate now"):_("activate now"));
- })),0,0,0);
+ $widget_temp
+ ),0,0,0);
# $clist1->append($_+1, "eth$_", $intf->{"eth$_"}{IPADDR}, $intf->{"eth$_"}{BOOTPROTO}, $all_cards[$_]->[1]);
# $clist1->set_selectable($_, 0);
# require Data::Dumper;
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;