From 75b84a911c38e0c911387bfee1d60411f3aa3420 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 13 Aug 2002 05:58:10 +0000 Subject: Write a standard mix.cfg configuration file for mixmaster --- Echolot/Pinger/Mix.pm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'Echolot/Pinger/Mix.pm') diff --git a/Echolot/Pinger/Mix.pm b/Echolot/Pinger/Mix.pm index f41f217..c5122cf 100644 --- a/Echolot/Pinger/Mix.pm +++ b/Echolot/Pinger/Mix.pm @@ -1,7 +1,7 @@ package Echolot::Pinger::Mix; # (c) 2002 Peter Palfrader -# $Id: Mix.pm,v 1.5 2002/07/22 02:18:30 weasel Exp $ +# $Id: Mix.pm,v 1.6 2002/08/13 05:58:10 weasel Exp $ # =pod @@ -34,7 +34,7 @@ sub ping($$$$) { print (F $keys->{$keyid}->{'key'},"\n\n"); }; close (F) or - cluck("Cannot close $keyring"), + cluck("Cannot close $keyring: $!"), return 0; my $type2list = Echolot::Config::get()->{'mixhome'}.'/type2.list'; @@ -45,9 +45,21 @@ sub ping($$$$) { print (F $keys->{$keyid}->{'summary'}, "\n"); }; close (F) or - cluck("Cannot close $type2list"), + cluck("Cannot close $type2list: $!"), return 0; + my $mixcfg = Echolot::Config::get()->{'mixhome'}.'/mix.cfg'; + unless ( -e $mixcfg ) { + open (F, ">$mixcfg") or + cluck("Cannot open $mixcfg for writing: $!"), + return 0; + print (F "PUBRING pubring.mix\n"); + print (F "TYPE2LIST type2.list\n"); + close (F) or + cluck("Cannot close $mixcfg: $!"), + return 0; + }; + $ENV{'MIXPATH'} = Echolot::Config::get()->{'mixhome'}; open(MIX, "|".Echolot::Config::get()->{'mixmaster'}." -m -S -l $chaincomma") or cluck("Cannot exec mixpinger: $!"), -- cgit v1.2.3