diff --git a/waccess b/waccess index 1fe1b66..7a00596 100755 --- a/waccess +++ b/waccess @@ -1,6 +1,6 @@ #!/usr/bin/env python # waccess - Copyright (c) 2001,2002, TundraWare Inc., All Rights Reserved -# $Id: waccess,v 1.5 2002/08/30 22:32:01 tundra Exp $ +# $Id: waccess,v 1.6 2002/08/30 23:24:24 tundra Exp $ # # Look for selected strings passed on the command line in the http access log. @@ -46,18 +46,20 @@ ########## LOG = "/var/log/httpd-access.log" -REVERSE = FALSE -SHOW = TRUE - +NOIGNORE = FALSE +REVERSE = FALSE +SHOW = TRUE try: - opts, args = getopt.getopt(sys.argv[1:], '-f:rs') + opts, args = getopt.getopt(sys.argv[1:], '-f:rsi') except getopt.GetoptError: usage() for opt, val in opts: if opt == "-f": LOG = val + if opt == "-i": + NOIGNORE = TRUE if opt == "-r": REVERSE = TRUE SHOW = TRUE @@ -83,12 +85,13 @@ total += 1 fields = record.split() - # See if this is an IP address to ignore + # See if this is an IP address to ignore unless user suppresses feature PROCESS = TRUE - for ignoreIP in IGNORED: - if fields[0].startswith(ignoreIP): - PROCESS = FALSE + if not NOIGNORE: + for ignoreIP in IGNORED: + if fields[0].startswith(ignoreIP): + PROCESS = FALSE if PROCESS: