diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-03-02 11:45:39 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-03-02 11:45:39 +0000 |
commit | 1009d9ad255561b32f619bdabf35703f0101ca07 (patch) | |
tree | a3eaba167cda8c4174b6dadfabbd937687dd5b01 /perl-install/standalone/net_applet | |
parent | cf250f3743f92d56053f0dc29ef5ba5fb4056e19 (diff) | |
download | drakx-backup-do-not-use-1009d9ad255561b32f619bdabf35703f0101ca07.tar drakx-backup-do-not-use-1009d9ad255561b32f619bdabf35703f0101ca07.tar.gz drakx-backup-do-not-use-1009d9ad255561b32f619bdabf35703f0101ca07.tar.bz2 drakx-backup-do-not-use-1009d9ad255561b32f619bdabf35703f0101ca07.tar.xz drakx-backup-do-not-use-1009d9ad255561b32f619bdabf35703f0101ca07.zip |
refresh every second, and do not reread network conf at each refresh
Diffstat (limited to 'perl-install/standalone/net_applet')
-rw-r--r-- | perl-install/standalone/net_applet | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet index 5473320bc..0972e0890 100644 --- a/perl-install/standalone/net_applet +++ b/perl-install/standalone/net_applet @@ -27,7 +27,10 @@ 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, $intf); +my $netcnx = {}; +my $netc = {}; +my $intf = {}; +network::netconnect::read_net_conf($netcnx, $netc, $intf); my $watched_interface; my %appletstate = ( @@ -152,10 +155,6 @@ sub netMonitor() { checkNetwork(); } sub checkNetwork() { - $netcnx = {}; - my $netc = {}; - $intf = {}; - network::netconnect::read_net_conf($netcnx, $netc, $intf); my ($gw_intf, $is_up, $gw_address, $dns_server) = network::tools::get_internet_connection($netc, $intf); my ($gw_intf, $is_up, $gw_address) = $watched_interface ? ($watched_interface, network::tools::get_interface_status($watched_interface)) : @@ -166,7 +165,8 @@ sub checkNetwork() { if ($new_md5 ne $current_md5) { exec($prog_name) } } sub checkNetworkForce() { - $current_state = "refresh"; + network::netconnect::read_net_conf($netcnx, $netc, $intf); + undef $current_state; checkNetwork(); } sub getIP { @@ -177,7 +177,7 @@ sub getIP { return wantarray() ? @ip : $ip[0]; } sub cronNetwork() { - $timeout = Glib::Timeout->add(5*1000, sub { + $timeout = Glib::Timeout->add(1000, sub { checkNetwork(); 1; }); |