Fixed command line processing logic to work when invoked with no args.
Changed default output file name to 'ABUSERS'
1 parent 5803321 commit 3bb65f734946c7860234b5d8f8c3c26829c956d6
@tundra tundra authored on 16 Jul 2001
Showing 1 changed file
View
8
abck
ANS = ";; ANSWER SECTION:"
AUTH = ";; AUTHORITY SECTION:"
DIG = "/usr/bin/dig -t ptr -x "
LOG = "/var/log/messages"
OUT = "./abusers"
 
VERSION = "$Id: abck,v 1.1 2001/07/16 20:00:50 tundra Exp $"
OUT = "./ABUSERS"
 
VERSION = "$Id: abck,v 1.2 2001/07/16 20:22:20 tundra Exp $"
 
####################
# Data Structures
####################
for logrecord in logfile.read().splitlines():
 
# Go check the record in no command line constraint given
# or a constraint is given and exits in the record
if not sys.argv[1] or logrecord.count(sys.argv[1]):
if (len(sys.argv) == 1) or logrecord.count(sys.argv[1]):
 
sendto = ProcessLogRecord(logrecord)
if sendto:
abuserfile.write("abnot \"" + logrecord + "\" " +