From 02c1a20bf695b21ef8b4d8809abd2e273394ae2b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 8 Jul 2005 04:27:03 +0000 Subject: [PATCH] fixed a bug with duplicate information in man page, removed link to sbin and now it should start from /usr/bin --- debian/fail2ban.init | 2 +- debian/fail2ban.links | 1 - fail2ban.h2m | 4 ++-- fail2ban.py | 8 ++++++-- 4 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 debian/fail2ban.links diff --git a/debian/fail2ban.init b/debian/fail2ban.init index 28e09d6c..fb4c937a 100644 --- a/debian/fail2ban.init +++ b/debian/fail2ban.init @@ -11,7 +11,7 @@ # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/sbin/fail2ban +DAEMON=/usr/bin/fail2ban NAME=fail2ban DESC=fail2ban PIDFILE=/var/run/$NAME.pid diff --git a/debian/fail2ban.links b/debian/fail2ban.links deleted file mode 100644 index a28cc7a5..00000000 --- a/debian/fail2ban.links +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/fail2ban /usr/sbin/fail2ban diff --git a/fail2ban.h2m b/fail2ban.h2m index b3af3cfa..3e8f9d07 100644 --- a/fail2ban.h2m +++ b/fail2ban.h2m @@ -10,8 +10,8 @@ fail2ban \- Ban IPs that make too many password failure [REPORTING BUGS] -We know that man page has duplicate of options. That will be -fixed soon. Hang on and don't report it for now. +Please report Debian related bugs via Debian bug tracking system +http://www.debian.org/Bugs/ [copyright] Copyright (c) 2004 Cyril Jaquier diff --git a/fail2ban.py b/fail2ban.py index 30f5ee60..212ce7fa 100755 --- a/fail2ban.py +++ b/fail2ban.py @@ -236,8 +236,9 @@ if __name__ == "__main__": # Reads the command line options. try: - optList, args = getopt.getopt(sys.argv[1:], 'hvbdkc:l:t:i:r:e:w:p:') + optList, args = getopt.getopt(sys.argv[1:], 'hvbdkc:l:t:i:r:e:w:p:', ['help','version']) except getopt.GetoptError: + sys.stderr.write("Error during parsing of command line parameters\n"); usage() # Pre-parsing of command line options for the -c option @@ -361,8 +362,11 @@ if __name__ == "__main__": logSys.warn("Using default value") for opt in optList: - if opt[0] == "-h": + if opt[0] in ["-h","--help"]: usage() + if opt[0] in ["--version"]: + print version + sys.exit(0) if opt[0] == "-v": conf["verbose"] = conf["verbose"] + 1 if opt[0] == "-b":