From 4e21b136d7880e830d8610902e1c20e8a63d6296 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 28 Jul 2024 20:18:34 +0800 Subject: [PATCH] Update index.py --- plugins/fail2ban/index.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/fail2ban/index.py b/plugins/fail2ban/index.py index 146523c65..885b7959e 100755 --- a/plugins/fail2ban/index.py +++ b/plugins/fail2ban/index.py @@ -17,6 +17,11 @@ if mw.isAppleSystem(): def getPluginName(): return 'fail2ban' +def f2bDir(): + return '/run/fail2ban' + +def f2bEtcDir(): + return '/etc/fail2ban' def getPluginDir(): return mw.getPluginDir() + '/' + getPluginName() @@ -38,7 +43,7 @@ def getInitDFile(): def getConf(): - path = getServerDir() + "/redis.conf" + path = f2bEtcDir() + "/fail2ban.conf" return path @@ -96,13 +101,10 @@ 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' - def getPidFile(): f2dir = f2bDir() return f2dir+'/fail2ban.pid'