use strict;
use IPC::Open3;
+my %config;
+
+#
+# readconfig
+#
+# Reads in our config file. Ignores any command it doesn't understand rather
+# than having to list all the ones that are of no interest to us.
+#
+sub readconfig {
+
+ open(CONFIG, "/home/noodles/projects/onak/onak.conf") or
+ die "Can't read config file: $!";
+
+ while (<CONFIG>) {
+ if (/^#/ or /^$/) {
+ # Ignore; comment line.
+ } elsif (/^this_site (.*)/) {
+ $config{'thissite'} = $1;
+ } elsif (/^maintainer_email (.*)/) {
+ $config{'adminemail'} = $1;
+ } elsif (/^mail_delivery_client (.*)/) {
+ $config{'mta'} = $1;
+ } elsif (/^syncsite (.*)/) {
+ push @{$config{'syncsites'}}, $1;
+ }
+ }
+
+ close(CONFIG);
+
+ return;
+}
+
#
# submitupdate
#
my @data = @_;
my (@errors, @mergedata);
- open3(\*MERGEIN, \*MERGEOUT, \*MERGEERR, "/home/noodles/onak-0.0.2/keymerge");
+ open3(\*MERGEIN, \*MERGEOUT, \*MERGEERR,
+ "/home/noodles/onak-0.0.3/onak", "add");
print MERGEIN @data;
close MERGEIN;
@errors = <MERGEERR>;
@mergedata = <MERGEOUT>;
- #print @errors;
+ open (LOG, ">>/home/noodles/onak-0.0.3/keyadd.log");
+ print LOG @errors;
+ close LOG;
return @mergedata;
}
$inheader = 1;
$subject = "";
+&readconfig;
while (<>) {
if ($inheader) {