diff --git a/plugins/fail2ban/index.py b/plugins/fail2ban/index.py index b2e8b3021..8cd136092 100755 --- a/plugins/fail2ban/index.py +++ b/plugins/fail2ban/index.py @@ -123,6 +123,13 @@ def contentReplace(content): return content +def initJailD(): + dst_conf = f2bEtcDir() + '/jail.d/default.conf' + dst_conf_tpl = getPluginDir() + '/tpl/jail.d/default.conf' + if not os.path.exists(dst_conf): + content = mw.readFile(dst_conf_tpl) + content = contentReplace(content) + mw.writeFile(dst_conf, content) def initDreplace(): @@ -143,6 +150,8 @@ def initDreplace(): # mw.writeFile(dst_conf, content) # mw.writeFile(dst_conf_init, 'ok') + initJailD() + # systemd systemDir = mw.systemdCfgDir() systemService = systemDir + '/' + getPluginName() + '.service' diff --git a/plugins/fail2ban/tpl/jail.d/default.conf b/plugins/fail2ban/tpl/jail.d/default.conf new file mode 100644 index 000000000..9ce9c7f4f --- /dev/null +++ b/plugins/fail2ban/tpl/jail.d/default.conf @@ -0,0 +1,2 @@ +[DEFAULT] +backend = systemd \ No newline at end of file