Skip to content
Snippets Groups Projects
Commit ed7b7ce8 authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

fix(fail2ban): detect ms installation

parent c98547df
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,8 @@ def setup(interactive=True):
target='/etc/fail2ban/filter.d/mediaserver.conf'
),
]
if os.path.exists("/home/msuser/mstmp/mediaserver.log"):
# if mediaserver is installed
if os.path.exists("/home/msuser/mstmp/mediaserver.log") or os.path.exists("/etc/mediaserver"):
cmds.append(dict(
line='write',
template='%s/jail.d/mediaserver.conf' % dir_path,
......@@ -44,11 +45,12 @@ def setup(interactive=True):
('{{ bantime }}', bantime),
)
))
# if campusmanager is installed
if os.path.exists("/home/skyreach/.skyreach/logs/skyreach.log"):
cmds.append(dict(
line='write',
template='%s/jail.d/skyreach.conf' % dir_path,
target='/etc/fail2ban/jail.d/skyreach.conf',
template='%s/jail.d/campusmanager.conf' % dir_path,
target='/etc/fail2ban/jail.d/campusmanager.conf',
params=(
('{{ action }}', action),
('{{ sender }}', sender),
......@@ -57,6 +59,7 @@ def setup(interactive=True):
('{{ bantime }}', bantime),
)
))
# if monitor is installed
if os.path.exists("/home/msmonitor/msmonitor/logs/site.log"):
cmds.append(dict(
line='write',
......
[skyreach]
[campusmanager]
enabled = true
filter = mediaserver
maxretry = {{ maxretry }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment