summaryrefslogblamecommitdiffstats
path: root/util/rebuildaloha.pl
blob: 06c06a824ec45554b06008143464b7278e457f17 (plain) (tree)




























                                                            
#!/usr/bin/perl
use lib '/home/bbs/bin/';
use LocalVars;
use strict;

my($prefix, $id, %inform, $tmp);

foreach $prefix ( 'a'..'z', 'A'..'Z' ){
    opendir DIR, "$BBSHOME/home/$prefix";
    foreach $id ( readdir(DIR) ){
    next if( $id =~ /\./ );
    print "importing $id\n";
    open FH, "$BBSHOME/home/$prefix/$id/alohaed";
    while( <FH> ){
        $tmp = substr($_, 0, 13);
        $tmp =~ s/ //g;
        push @{$inform{$tmp}}, $id;
    }
    close FH;
    }
    closedir DIR;
}

foreach( keys %inform ){
    print "updating $_\n";
    open FH, ">$BBSHOME/home/".substr($_, 0, 1)."/$_/aloha";
    print FH "$_