mirror of https://github.com/fail2ban/fail2ban
- Removed warning when using "-V" or "-h" with no config file. Thanks to Yaroslav Halchenko
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@182 a942ae1a-1317-0410-a47c-b1dcaea8d6050.5
parent
ed46bcdaf2
commit
8a1241533f
13
fail2ban.py
13
fail2ban.py
|
@ -114,10 +114,6 @@ def getCmdLineOptions(optList):
|
|||
""" Gets the command line options
|
||||
"""
|
||||
for opt in optList:
|
||||
if opt[0] in ["-h", "--help"]:
|
||||
dispUsage()
|
||||
if opt[0] in ["-V", "--version"]:
|
||||
dispVersion()
|
||||
if opt[0] == "-v":
|
||||
conf["verbose"] = conf["verbose"] + 1
|
||||
if opt[0] == "-b":
|
||||
|
@ -166,6 +162,10 @@ def main():
|
|||
for opt in optList:
|
||||
if opt[0] == "-c":
|
||||
conf["conffile"] = opt[1]
|
||||
if opt[0] in ["-h", "--help"]:
|
||||
dispUsage()
|
||||
if opt[0] in ["-V", "--version"]:
|
||||
dispVersion()
|
||||
|
||||
# Reads the config file and create a LogReader instance for
|
||||
# each log file to check.
|
||||
|
@ -276,7 +276,10 @@ def main():
|
|||
logSys.error("Fail2Ban already running with PID "+pid)
|
||||
sys.exit(-1)
|
||||
else:
|
||||
pidLock.create()
|
||||
ret = pidLock.create()
|
||||
if not ret:
|
||||
# Unable to create PID lock. Exit
|
||||
sys.exit(-1)
|
||||
|
||||
logSys.debug("ConfFile is " + conf["conffile"])
|
||||
logSys.debug("BanTime is " + `conf["bantime"]`)
|
||||
|
|
Loading…
Reference in New Issue