From 8466aaad84a10e7742f8687e593b18888c677767 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 24 Jun 2022 11:59:51 +0800 Subject: [PATCH] pureftp to systemd ok --- plugins/pureftp/index.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/pureftp/index.py b/plugins/pureftp/index.py index aff31c3cf..ab53099dc 100755 --- a/plugins/pureftp/index.py +++ b/plugins/pureftp/index.py @@ -109,6 +109,16 @@ def initDreplace(): content = contentReplace(content) mw.writeFile(pureFtpdConfig, content) + # systemd + systemDir = '/lib/systemd/system' + systemService = systemDir + '/pureftp.service' + systemServiceTpl = getPluginDir() + '/init.d/pureftp.service.tpl' + if os.path.exists(systemDir) and not os.path.exists(systemService): + se_content = mw.readFile(systemServiceTpl) + se_content = se_content.replace('{$SERVER_PATH}', service_path) + mw.writeFile(systemService, se_content) + mw.execShell('systemctl daemon-reload') + return file_bin