summaryrefslogblamecommitdiffstats
path: root/util/rebuildaloha.pl
blob: c8262e41ae520624fb96194bb5b27ea89f1bddc9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                         



                                                            

















                                                            
#!/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 =~ /\./ );
    if( $id =~ /[^a-zA-Z0-9]/ ){
        `mv '$BBSHOME/home/$prefix/$id/' $BBSHOME/tmp/`;
        next;
    }
    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 "$_