From ae62bee78d3b9432cacc0eaa865f8c7d7d25e604 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 28 Jul 2024 19:54:38 +0800 Subject: [PATCH] update --- plugins/fail2ban/index.html | 3 --- plugins/fail2ban/index.py | 18 ++++-------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/plugins/fail2ban/index.html b/plugins/fail2ban/index.html index edf3581f2..ee2ee6367 100755 --- a/plugins/fail2ban/index.html +++ b/plugins/fail2ban/index.html @@ -16,9 +16,6 @@

配置修改

性能调整

负载状态

-

复制状态

-

集群状态

-

集群节点

运行日志

diff --git a/plugins/fail2ban/index.py b/plugins/fail2ban/index.py index 5bdaa64b0..375853b35 100755 --- a/plugins/fail2ban/index.py +++ b/plugins/fail2ban/index.py @@ -96,6 +96,9 @@ def readConfigTpl(): content = mw.readFile(args['file']) content = contentReplace(content) return mw.returnJson(True, 'ok', content) + +def runLog(): + return '/var/log/fail2ban.log' def f2bDir(): return '/run/fail2ban' @@ -191,18 +194,6 @@ def reload(): return f2bOp('reload') -def getPort(): - conf = getServerDir() + '/redis.conf' - content = mw.readFile(conf) - - rep = r"^(" + r'port' + r')\s*([.0-9A-Za-z_& ~]+)' - tmp = re.search(rep, content, re.M) - if tmp: - return tmp.groups()[1] - - return '6379' - - def initdStatus(): current_os = mw.getOs() if current_os == 'darwin': @@ -255,8 +246,7 @@ def initdUinstall(): return 'ok' -def runLog(): - return '/var/log/fail2ban.log' + if __name__ == "__main__":