diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-22 14:06:39 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-22 14:06:39 +0800 |
commit | 147cd117ecb4dc79b0c9994746d772a46cca9a8e (patch) | |
tree | 446bac7859172ac27900e9de05ff44a64eb55e61 /innbbsd/inncheck.pl | |
parent | dfef8450db51ec44318415f48af592764160d2ea (diff) | |
download | pttbbs-147cd117ecb4dc79b0c9994746d772a46cca9a8e.tar pttbbs-147cd117ecb4dc79b0c9994746d772a46cca9a8e.tar.gz pttbbs-147cd117ecb4dc79b0c9994746d772a46cca9a8e.tar.bz2 pttbbs-147cd117ecb4dc79b0c9994746d772a46cca9a8e.tar.lz pttbbs-147cd117ecb4dc79b0c9994746d772a46cca9a8e.tar.xz pttbbs-147cd117ecb4dc79b0c9994746d772a46cca9a8e.tar.zst pttbbs-147cd117ecb4dc79b0c9994746d772a46cca9a8e.zip |
check program for newsfeeds.bbsstable.rc@1075pttbbs-beforefav4@1075victor.symblic@1075victor.solaris@1075victor.screen@1075victor.edit@1075scw.telnet@1075scw.brc2@1075scw.angel@1075refactor@1075pttbbs.sr_digest@1075pttbbs.pwcu@1075pttbbs.no_pwcu@1075ptt.testclient@1075ptt.linux@1075ptt.fpg@1075piaip.newlayout@1075piaip.automake@1075outtacache@1075Ptt.save_title@1075Ptt.register@1075Ptt.read@1075Ptt.merge@1075Kuolin.test@1075Jaky.i18n@1075
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1075 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'innbbsd/inncheck.pl')
-rw-r--r-- | innbbsd/inncheck.pl | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/innbbsd/inncheck.pl b/innbbsd/inncheck.pl new file mode 100644 index 00000000..2b98a305 --- /dev/null +++ b/innbbsd/inncheck.pl @@ -0,0 +1,47 @@ +#!/usr/bin/perl +use IO::Socket::INET; +$BBSHOME = '/home/bbs'; + +open NODES, "<$BBSHOME/innd/nodelist.bbs"; +while( <NODES> ){ + next if( /^\#/ ); + + ($nodename, $host) = $_ =~ /^(\S+)\s+(\S+)/; + next if( !$nodename ); + + $sock = IO::Socket::INET->new(PeerAddr => $host, + PeerPort => 119, + Proto => 'tcp'); + next if( !$sock ); + $sock->write("list\r\nquit\r\n"); + $sock->read($data, 104857600); + + foreach( split("\n", $data) ){ + $group{$nodename}{$1} = 1 + if( /^([A-Za-z0-9\.]+) \d+ \d+ y/ ); + } +} + +open FEEDS, "<$BBSHOME/innd/newsfeeds.bbs"; +while( <FEEDS> ){ + ++$line; + next if( /^\#/ ); + + next if( !(($gname, $board, $nodename) = + $_ =~ /^([\w\.]+)\s+(\w+)\s+(\w+)/) ); + + if( !-d ("$BBSHOME/boards/". substr($board, 0, 1). "/$board") ){ + print "$line: board not found ($board)\n"; + next; + } + + if( !$group{$nodename} ){ + print "$line: node not found ($nodename)\n"; + next; + } + + if( !$group{$nodename}{$gname} ){ + print "$line: group not found ($gname)\n"; + } +} + |