From f75f2e728276cbc91c434e920b53c5b15513e570 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 2 Jul 2002 17:12:45 +0000 Subject: Implemented dumpconf command --- Echolot/Config.pm | 16 +++++++++++++++- TODO | 1 - pingd | 20 ++++++++++++++++++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/Echolot/Config.pm b/Echolot/Config.pm index 057b6ee..7e7a55a 100644 --- a/Echolot/Config.pm +++ b/Echolot/Config.pm @@ -1,7 +1,7 @@ package Echolot::Config; # (c) 2002 Peter Palfrader -# $Id: Config.pm,v 1.5 2002/07/02 17:04:21 weasel Exp $ +# $Id: Config.pm,v 1.6 2002/07/02 17:12:45 weasel Exp $ # =pod @@ -84,5 +84,19 @@ sub get() { return $CONFIG; }; +sub dump() { + # FIXME XML::Dumper bug workaround + # There is a bug in pl2xml that changes data passed (cf. Debian Bug #148969 and #148970 + # at http://bugs.debian.org/148969 and http://bugs.debian.org/148970 + require Data::Dumper; + my $storedata; + eval ( Data::Dumper->Dump( [ $CONFIG ], [ 'storedata' ] )); + + my $dump = new XML::Dumper; + my $data = $dump->pl2xml($storedata); + + print $data; +}; + 1; # vim: set ts=4 shiftwidth=4: diff --git a/TODO b/TODO index c720f13..4966e41 100644 --- a/TODO +++ b/TODO @@ -3,7 +3,6 @@ for 2.0: make a private [rm]list showing all remailers ping cpunk without pgponly in clear too configure pinging options (i.e. cpunkt-{rsa,dsa,none}, mix) - add showconf command for later: rotate secret diff --git a/pingd b/pingd index aa70998..f027e39 100755 --- a/pingd +++ b/pingd @@ -1,7 +1,7 @@ #!/usr/bin/perl -wT # (c) 2002 Peter Palfrader -# $Id: pingd,v 1.9 2002/07/02 17:03:12 weasel Exp $ +# $Id: pingd,v 1.10 2002/07/02 17:12:45 weasel Exp $ # =pod @@ -22,6 +22,8 @@ pingd - echolot ping daemon =item B B option=value [option=value..] I
[I
...] +=item B B + =back =head1 DESCRIPTION @@ -80,9 +82,21 @@ either B or B. =back +=item B + +Dumps the current configuration to standard output. + =head1 OPTIONS -none +=over + +=item --verbose + +Verbose mode. Causes B to print debugging messages about its progress. + +=item --help + +Print a short help and exit sucessfully. =back @@ -237,6 +251,8 @@ if ($COMMAND eq 'add') { Echolot::Globals::get()->{'storage'}->commit(); Echolot::Globals::get()->{'storage'}->finish(); +} elsif ($COMMAND eq 'dumpconf') { + Echolot::Config::dump(); } elsif ($COMMAND eq 'convert') { Echolot::Globals::initStorage(); setSigHandlers(); -- cgit v1.2.3