From 8fc41a1333f01496878ca0561f3ca1ad186b6d64 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 3 Jun 2005 07:14:48 +0000 Subject: - merge network settings in a $net hash (it modifies $o fields too): o $netc becomes $net->{network} and $net->{resolv} o $intf becomes $net->{ifcfg} - move zeroconf config stuff in write_zeroconf - read_tmdns_conf -> read_zeroconf - read_all_conf -> read_net_conf - configureNetwork2 -> configure_network - configure_network: write ifcfg files for ppp interfaces too - don't install wireless-tools in configure_network, this package is in basesystem - most functions don't need the file path as an argument in network::network - drop network::tools::remove_initscript - don't export too much from network::network - don't export from network::tools - remove adsl_unsupported_eci step in drakconnect - drop passwd2 field in network::adsl - drop $net->{isdn_internal} - network::netconnect : main -> safe_main - use network::netconnect::real_main during install - don't read network config in network::netconnect::real_main - install_steps::upNetwork : resolv.conf is already symlinked by network::network::configure_network when appropriate - try to fix install_any::generate_automatic_stage1_params to use a real interface configuration - put authentication stuff in $net->{auth} - drop network::ethernet::write_ether_conf - drop network::adsl::get_wizard - use 'static' instead of 'manual' as ADSL method - drop first_modem and its workarounds in network::modem - drop deprecated "multiple_internet_cnx" step in drakconnect - don't save /etc/sysconfig/drakconnect anymore - drop MDK::Common::Globals stuff - drop getIP in net_applet (Pixel) - drop $netc->{DHCP} - configure_network(): write resolv.conf even if a dhcp interface is configured --- perl-install/standalone/net_applet | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'perl-install/standalone/net_applet') diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet index 28d7c8e11..1311da3fe 100644 --- a/perl-install/standalone/net_applet +++ b/perl-install/standalone/net_applet @@ -6,7 +6,7 @@ use c; use common; use standalone; use Digest::MD5; -use network::netconnect; +use network::network; use network::tools; use mygtk2 qw(gtknew); @@ -27,9 +27,7 @@ is_running('net_applet') and die "net_applet already running\n"; my $prog_name = "/usr/bin/net_applet"; my $current_md5 = md5file($prog_name); -my $netcnx = {}; -my $netc = {}; -my $intf = {}; +my $net = {}; my $watched_interface; $SIG{HUP} = sub { @@ -72,7 +70,7 @@ my %actions = ( 'confNetwork' => { name => N("Configure Network"), launch => sub { system("/usr/sbin/drakconnect --skip-wizard &") } }, 'chooseInterface' => { name => N("Watched interface"), - choices => sub { N("Auto-detect"), sort keys %$intf }, + choices => sub { N("Auto-detect"), sort keys %{$net->{ifcfg}} }, choice_selected => sub { $watched_interface ? $_[0] eq $watched_interface : $_[0] eq N("Auto-detect") }, launch => sub { $watched_interface = $_[0] eq N("Auto-detect") ? undef : $_[0]; @@ -82,10 +80,10 @@ my %actions = ( 'chooseProfile' => { name => N("Profiles"), choices => sub { network::network::netprofile_list() }, - choice_selected => sub { $_[0] eq $netc->{PROFILE} }, + choice_selected => sub { $_[0] eq $net->{PROFILE} }, launch => sub { - $netc->{PROFILE} = $_[0]; - network::tools::bg_command_as_root('/sbin/set-netprofile', $netc->{PROFILE}); + $net->{PROFILE} = $_[0]; + network::tools::bg_command_as_root('/sbin/set-netprofile', $net->{PROFILE}); } }, 'refresh' => { name => N("Refresh"), launch => sub { checkNetworkForce() } }, @@ -161,27 +159,18 @@ sub netMonitor() { sub checkNetwork() { my ($gw_intf, $_is_up, $gw_address) = $watched_interface ? ($watched_interface, network::tools::get_interface_status($watched_interface)) : - network::tools::get_internet_connection($netc, $intf); + network::tools::get_internet_connection($net); go2State($gw_address ? 'connected' : $gw_intf ? 'disconnected' : 'notconfigured', $gw_intf); my $new_md5 = md5file($prog_name); if ($new_md5 ne $current_md5) { exec($prog_name) } } sub checkNetworkForce() { - $netcnx = {}; - $netc = {}; - $intf = {}; - network::netconnect::read_net_conf($netcnx, $netc, $intf); + $net = {}; + network::network::read_net_conf($net); undef $current_state; checkNetwork(); } -sub getIP { - my ($interface) = shift; - my $ifconfig = '/sbin/ifconfig'; - my @lines = `$ifconfig $interface`; - my @ip = map { if_(/inet adr:([\d.]+)/, $1) } @lines; - return wantarray() ? @ip : $ip[0]; -} sub cronNetwork() { $timeout = Glib::Timeout->add(2000, sub { checkNetwork(); -- cgit v1.2.1