diff options
author | Peter Palfrader <peter@palfrader.org> | 2003-02-21 06:37:52 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2003-02-21 06:37:52 +0000 |
commit | 70ac732dbf0595f3df5e967db594dbc35a357dcc (patch) | |
tree | 46c62c658914ef3ef15ea7d36a1f3e7b507218e0 | |
parent | d3b3dfdd1817df27fc247f91cc7b7d2755dbee2c (diff) |
Add sendchainpings command
-rw-r--r-- | Echolot/Commands.pm | 4 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rwxr-xr-x | debian/echolot.init | 2 | ||||
-rwxr-xr-x | pingd | 37 | ||||
-rwxr-xr-x | tools/pingctl | 2 |
5 files changed, 41 insertions, 6 deletions
diff --git a/Echolot/Commands.pm b/Echolot/Commands.pm index 0ae4bf9..df475b0 100644 --- a/Echolot/Commands.pm +++ b/Echolot/Commands.pm @@ -1,7 +1,7 @@ package Echolot::Commands; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: Commands.pm,v 1.14 2003/02/20 19:39:03 weasel Exp $ +# $Id: Commands.pm,v 1.15 2003/02/21 06:37:52 weasel Exp $ # =pod @@ -71,6 +71,8 @@ sub processCommands($) { Echolot::Globals::get()->{'scheduler'}->schedule('getkeyconf', 0, time(), \@args ); } elsif ($command eq 'sendpings') { Echolot::Globals::get()->{'scheduler'}->schedule('ping', 0, time(), \@args ); + } elsif ($command eq 'sendchainpings') { + Echolot::Globals::get()->{'scheduler'}->schedule('chainping', 0, time(), \@args ); } elsif ($command eq 'buildstats') { Echolot::Globals::get()->{'scheduler'}->schedule('buildstats', 0, time() ); } elsif ($command eq 'buildkeys') { @@ -21,12 +21,14 @@ Changes in version Several other settings control the details of chain pinging. You probably don't want or need to tweak them. See the pingd.conf(5) manual page for details. + - Also adds the new "sendchainpings" command. * Create an index.txt file in the thesaurus directory which holds id, nick, and address for each remailer in the thesaurus. This helps additional tools to utilize Echolot's data. * Compile a list of default From: lines as well as a list of remailers which allow user supplied From headers. * Print status summary to log daily. + - Also adds the new "summary" command. * Reliable and CRLF - a neverending (sad) story. Changes in version 2.0.10 - 2003-02-03 diff --git a/debian/echolot.init b/debian/echolot.init index 29c89c9..3916ddc 100755 --- a/debian/echolot.init +++ b/debian/echolot.init @@ -134,7 +134,7 @@ reload|force-reload|restart) wait_for_deaddaemon $PID $0 start ;; -process|add|delete|set|setremailercaps|deleteremailercaps|getkeyconf|sendpings|buildstats|buildkeys|buildthesaurus|buildfromlines|dumpconf|summary) +process|add|delete|set|setremailercaps|deleteremailercaps|getkeyconf|sendpings|sendchainpings|buildstats|buildkeys|buildthesaurus|buildfromlines|dumpconf|summary) # Check for right User SU="" if [ "$CHECKUID" -gt "0" ]; then @@ -3,7 +3,7 @@ $| = 1; # (c) 2002, 2003 Peter Palfrader <peter@palfrader.org> -# $Id: pingd,v 1.100 2003/02/20 19:39:03 weasel Exp $ +# $Id: pingd,v 1.101 2003/02/21 06:37:52 weasel Exp $ # =pod @@ -36,6 +36,8 @@ pingd - echolot ping daemon =item B<pingd> B<sendpings> [I<address> [I<address> ...]] +=item B<pingd> B<sendchainpings> I<address>B<:>I<address> [I<address>B<:>I<address> ...] + =item B<pingd> B<buildstats> =item B<pingd> B<buildkeys> @@ -44,6 +46,8 @@ pingd - echolot ping daemon =item B<pingd> B<buildfromlines> +=item B<pingd> B<summary> + =item B<pingd> B<dumpconf> =back @@ -140,6 +144,11 @@ If no addresses are given requests will be sent to all remailers. Send a command to immediatly send pings to the given remailers. If no addresses are given requests will be sent to all remailers. +=item B<sendchainpings> I<address>B<:>I<address> [I<address>B<:>I<address> ...] + +Send a command to immediatly send chain pings to the given chains. +A chain is two remailer addresses seperated by a colon. + =item B<buildstats> Send a command to immediatly rebuild stats. @@ -194,8 +203,9 @@ Print version number and exit sucessfully. =item B<--nohup> Usefull only with the B<add>, B<set>, B<setremailercaps>, -B<deleteremailercaps>, B<getkeyconf>, B<sendpings>, B<buildstats>, -B<buildkeys>, B<buildthesaurus>, B<buildfromlines> or B<summary> command. +B<deleteremailercaps>, B<getkeyconf>, B<sendpings>, B<sendchainpings>, +B<buildstats>, B<buildkeys>, B<buildthesaurus>, B<buildfromlines>, +or B<summary> command. Don't send a HUP signal to the daemon which instructs it to process the commands after adding the command to the task list. @@ -456,6 +466,23 @@ sub command_sendpings(@) { }; }; +sub command_sendchainpings(@) { + my @argv = @_; + + my @args; + for my $arg (@argv) { + my ($addr1, $addr2) = split /:/, $arg; + die ("Argument $arg is not in the form address1:address2") unless defined $addr1 && defined $addr2; + die ("Address 1 in $arg ('$addr1') is not a valid email address\n") unless ($addr1 =~ /^[a-zA-Z0-9+._-]+\@[a-zA-Z0-9+.-]+$/ ); + die ("Address 2 in $arg ('$addr2') is not a valid email address\n") unless ($addr2 =~ /^[a-zA-Z0-9+._-]+\@[a-zA-Z0-9+.-]+$/ ); + push @args, [ $addr1, $addr2 ]; + }; + + for my $arg (@args) { + Echolot::Commands::addCommand("sendchainpings $arg->[0] $arg->[1]"); + }; +}; + sub pid_exists($) { my ($remove_stale) = @_; @@ -651,6 +678,7 @@ if ($params->{'help'}) { print (" deleteremailercaps ... delete remailer capabilities manually\n"); print (" getkeyconf ... request remailer-xxx data immediatly\n"); print (" sendpings ... request immediate sending of pings\n"); + print (" sendchainpings ... request immediate sending of chainpings\n"); print (" buildstats ... build remailer stats immediatly\n"); print (" buildkeys ... buid keyrings immediatly\n"); print (" buildthesaurus ... build thesaurus immediatly\n"); @@ -694,6 +722,9 @@ if ($COMMAND eq 'add' || $COMMAND eq 'delete') { } elsif ($COMMAND eq 'sendpings') { command_sendpings(@ARGV); hup_if_wanted($params->{'nohup'}); +} elsif ($COMMAND eq 'sendchainpings') { + command_sendchainpings(@ARGV); + hup_if_wanted($params->{'nohup'}); } elsif ($COMMAND eq 'buildstats') { Echolot::Commands::addCommand("buildstats"); hup_if_wanted($params->{'nohup'}); diff --git a/tools/pingctl b/tools/pingctl index 3a3ede6..9304734 100755 --- a/tools/pingctl +++ b/tools/pingctl @@ -94,7 +94,7 @@ reload|force-reload|restart) sleep 10 $0 start ;; -process|add|delete|set|setremailercaps|deleteremailercaps|getkeyconf|sendpings|buildstats|buildkeys|buildthesaurus|buildfromlines|dumpconf|summary) +process|add|delete|set|setremailercaps|deleteremailercaps|getkeyconf|sendpings|sendchainpings|buildstats|buildkeys|buildthesaurus|buildfromlines|dumpconf|summary) echo "Running pingd $1..." if [ ! -z "$SU" ]; then $SU "$PINGD \"$@\"" |