summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-07-18 10:30:01 +0000
committerOlivier Blin <oblin@mandriva.org>2005-07-18 10:30:01 +0000
commit6c1b55168cdf18fa8b4dcea2b0db6370395701ba (patch)
treeefd4a1b4c356cd9f2ac9c3897689324ce1435a77 /perl-install/standalone
parent2df2ae928b6de7030d2d3f759e0ec7e363afd633 (diff)
downloaddrakx-6c1b55168cdf18fa8b4dcea2b0db6370395701ba.tar
drakx-6c1b55168cdf18fa8b4dcea2b0db6370395701ba.tar.gz
drakx-6c1b55168cdf18fa8b4dcea2b0db6370395701ba.tar.bz2
drakx-6c1b55168cdf18fa8b4dcea2b0db6370395701ba.tar.xz
drakx-6c1b55168cdf18fa8b4dcea2b0db6370395701ba.zip
use common::md5file
Diffstat (limited to 'perl-install/standalone')
-rw-r--r--perl-install/standalone/net_applet14
1 files changed, 2 insertions, 12 deletions
diff --git a/perl-install/standalone/net_applet b/perl-install/standalone/net_applet
index 3bfd5264c..81be77940 100644
--- a/perl-install/standalone/net_applet
+++ b/perl-install/standalone/net_applet
@@ -27,7 +27,7 @@ add_icon_path("/usr/share/libDrakX/pixmaps/");
# Allow multiple instances, but only one per user:
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 $current_md5 = common::md5file($prog_name);
my $net = {};
my $watched_interface;
@@ -140,16 +140,6 @@ sub shouldStart() {
}
return getAutoStart();
}
-sub md5file {
- my @md5;
- foreach my $file (@_) {
- open(my $FILE, $file) or do { print STDERR "Can not open '$file': $!"; push @md5, "" };
- binmode($FILE);
- push @md5, Digest::MD5->new->addfile($FILE)->hexdigest;
- close($FILE);
- }
- return wantarray() ? @md5 : $md5[0];
-}
sub netMonitor() {
system("/usr/sbin/net_monitor&");
checkNetwork();
@@ -181,7 +171,7 @@ sub checkNetwork() {
network::tools::get_internet_connection($net);
go2State($gw_address ? 'connected' : $gw_intf ? 'disconnected' : 'notconfigured', $gw_intf);
- my $new_md5 = md5file($prog_name);
+ my $new_md5 = common::md5file($prog_name);
if ($new_md5 ne $current_md5) { exec($prog_name) }
}
sub checkNetworkForce() {