Having a problem getting a py script to execute. Got this error:
File "/scripts/blockIPv4.py", line 19
ip = line.split(';')[0]
^
IndentationError: expected an indented block
I'm perplexed because the code that the error refers to *is* indented:
with open('/var/www/html/mydomain.com/banlist.txt','r') as inFile:
for line in inFile.readlines():
ip = line.split(';')[0]
output = os.popen( '/etc/sysconfig/iptables -A INPUT -s ' + ip
+ ' -j REJECT' )
logFile.write(ip+' - Has been blocked\n')
What am I missing here?
--
My email address on the header is a non-monitored spam catching account.
I can be reached via http://www.wvnh.net/contact.htm
--
http://mail.python.org/mailman/listinfo/python-list