mirror of https://github.com/fail2ban/fail2ban
- Added obsolete files detection and update config reminder after install
git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/branches/FAIL2BAN-0_5@144 a942ae1a-1317-0410-a47c-b1dcaea8d6050.5
parent
2b8df84fa9
commit
74dfb8440e
30
setup.py
30
setup.py
|
@ -28,6 +28,8 @@ __license__ = "GPL"
|
|||
|
||||
from distutils.core import setup
|
||||
from version import version
|
||||
from os.path import isfile, join
|
||||
from sys import exit, argv
|
||||
|
||||
setup(
|
||||
name = "fail2ban",
|
||||
|
@ -40,3 +42,31 @@ setup(
|
|||
py_modules = ['fail2ban', 'version'],
|
||||
packages = ['firewall', 'logreader', 'confreader', 'utils']
|
||||
)
|
||||
|
||||
# Do some checks after installation
|
||||
# Search for obsolete files.
|
||||
obsoleteFiles = []
|
||||
elements = {"/usr/bin/": ["fail2ban.py"],
|
||||
"/usr/lib/fail2ban/firewall/": ["iptables.py", "ipfwadm.py",
|
||||
"ipfw.py"]}
|
||||
for dir in elements:
|
||||
for f in elements[dir]:
|
||||
path = join(dir, f)
|
||||
if isfile(path):
|
||||
obsoleteFiles.append(path)
|
||||
if obsoleteFiles:
|
||||
print
|
||||
print "Obsolete files from previous Fail2Ban versions were found on " \
|
||||
"your system."
|
||||
print "Please delete them:"
|
||||
print
|
||||
for f in obsoleteFiles:
|
||||
print "\t" + f
|
||||
print
|
||||
|
||||
# Update config file
|
||||
if argv[1] == "install":
|
||||
print
|
||||
print "Please do not forget to update your configuration file."
|
||||
print "Use config/fail2ban.conf.default as example."
|
||||
print
|
||||
|
|
Loading…
Reference in New Issue