From 4a10af5d62d93aa14a279d89d75a1dfb7c159879 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 10 Jul 2002 12:42:56 +0000 Subject: Added --process switch --- pingd | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pingd b/pingd index 508eb67..05bb6aa 100755 --- a/pingd +++ b/pingd @@ -1,7 +1,7 @@ #!/usr/bin/perl -wT # (c) 2002 Peter Palfrader -# $Id: pingd,v 1.23 2002/07/10 12:27:51 weasel Exp $ +# $Id: pingd,v 1.24 2002/07/10 12:42:56 weasel Exp $ # =pod @@ -146,7 +146,7 @@ Print version number and exit sucessfully. =item --nohup -Usefull only when passwd with the B, B, B, +Usefull only when passed with the B, B, B, B or B command. Don't send a HUP signal to the daemon which instructs it to process the @@ -154,6 +154,12 @@ commands after adding the command to the task list. Per default such a signal is sent. +=item --process + +Usefull only when passed with the B command. + +Read and process the commands file on startup. + =item --detach Usefull only when passwd with the B command. @@ -367,6 +373,9 @@ sub daemon_run() { $scheduler->add('getkeyconf' , Echolot::Config::get()->{'getkeyconf'} , 0, \&Echolot::Conf::send_requests ); $scheduler->add('check_resurrection' , Echolot::Config::get()->{'check_resurrection'} , 0, \&Echolot::Conf::check_resurrection ); + Echolot::Globals::get()->{'scheduler'}->schedule('readcommands', time() ) + if ($params->{'process'}); + $scheduler->run(); Echolot::Globals::get()->{'storage'}->commit(); @@ -451,6 +460,7 @@ if (!GetOptions ( 'verbose' => \$params->{'verbose'}, 'nohup' => \$params->{'nohup'}, 'detach' => \$params->{'detach'}, + 'process' => \$params->{'process'}, )) { die ("$PROGRAM_NAME: Usage: $PROGRAM_NAME [-fwhv]\n"); }; -- cgit v1.2.3