summaryrefslogtreecommitdiff
path: root/pingd
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2002-06-11 10:10:34 +0000
committerPeter Palfrader <peter@palfrader.org>2002-06-11 10:10:34 +0000
commitd991d82bfacf778a24d5624de8fd1e5d34c4c36b (patch)
tree30717fc6077695bfe4b958eb148e8c02a50c2f96 /pingd
parent320340f881112fc6834e54a99951afb0803ad9c4 (diff)
example run
Diffstat (limited to 'pingd')
-rwxr-xr-xpingd22
1 files changed, 9 insertions, 13 deletions
diff --git a/pingd b/pingd
index fc49d0f..2b4660a 100755
--- a/pingd
+++ b/pingd
@@ -1,7 +1,7 @@
#!/usr/bin/perl -wT
# (c) 2002 Peter Palfrader <peter@palfrader.org>
-# $Id: pingd,v 1.2 2002/06/11 00:09:29 weasel Exp $
+# $Id: pingd,v 1.3 2002/06/11 10:10:34 weasel Exp $
#
use strict;
@@ -12,9 +12,10 @@ use lib '.';
use Echolot::Config;
use Echolot::Globals;
use Echolot::Storage::File;
-#use Echolot::Scheduler;
+use Echolot::Scheduler;
use Echolot::Conf;
use Echolot::Mailin;
+use Echolot::Pinger;
$ENV{'PATH'} = '/bin:/usr/bin';
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
@@ -22,19 +23,14 @@ delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
Echolot::Config::init();
Echolot::Globals::init();
-#my $storage = new Echolot::Storage::File ( datadir => 'data' );
-#my $conf = new Echolot::Conf( storage => $storage );
+my $scheduler = new Echolot::Scheduler;
-#$conf->send_requests();
-
-#my @addr = $storage->get_query_addresses();
+$scheduler->add('processmail' , 60 , 0, \&Echolot::Mailin::process );
+$scheduler->add('getkeyconf' , 10*60 , 0, \&Echolot::Conf::send_requests );
+$scheduler->add('ping' , Echolot::Config::get()->{'pinger_interval'}, 0, \&Echolot::Pinger::send_pings );
-#require Data::Dumper;
-#print Data::Dumper->Dump([Echolot::Globals::get()]);
-#Echolot::Conf::send_requests();
-Echolot::Mailin::process();
-
-Echolot::Globals::get()->{'storage'}->commit();
+$scheduler->run();
+#Echolot::Globals::get()->{'storage'}->commit();
# vim: set ts=4 shiftwidth=4: