#!/usr/local/bin/pike // RBL checker // (c)iMil / 2000 // This software is copyrighted under the GNU GPL // ftp://ftp.gcu-squad.org/pub/pike/COPYING #define CONF "/usr/local/etc/checkbl.conf" void usage(string arg) { write("usage: "+arg+" \n"); exit(1); } int|void main(int argc, array argv) { if (argc < 2) usage(argv[0]); object fd=Stdio.File(); if (!fd->open(CONF, "r")) { write(CONF+" not found.\ncreate it with the BLs list you want to use\n"); write("example:\nrbl.maps.vix.com\nrelays.orbs.org\ndul.maps.vix.com\n"); exit(1); } string tmp=fd->read(); fd->close(); array hosts=tmp / "\n"; object host=Protocols.DNS.client(); string host; array res=gethostbyname(argv[1]); if (res) host=res[1][0]; else { write("Wrong ip or hostname\n"); exit(1); } array arev=host / "."; host=arev[3]+"."+arev[2]+"."+arev[1]+"."+arev[0]; for (int i=0;i