From b350747eab28d1c3873b3104ea7974e7b9bbead8 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 29 Nov 2024 18:21:12 +0800 Subject: [PATCH] update --- plugins/acme_pandominassl_apply/index.py | 1 - plugins/alist/index.py | 2 +- plugins/cloudreve/index.py | 2 +- plugins/fail2ban/index.py | 3 +-- plugins/gorse/index.py | 2 +- plugins/haproxy/index.py | 2 +- plugins/keepalived/index.py | 5 ++--- plugins/lvs/index.py | 2 +- plugins/mosquitto/index.py | 2 +- plugins/simpleping/index.py | 3 +-- plugins/sphinx/index.py | 3 +-- 11 files changed, 11 insertions(+), 16 deletions(-) diff --git a/plugins/acme_pandominassl_apply/index.py b/plugins/acme_pandominassl_apply/index.py index 1679e0bf9..cd21cf2a8 100755 --- a/plugins/acme_pandominassl_apply/index.py +++ b/plugins/acme_pandominassl_apply/index.py @@ -167,7 +167,6 @@ def pSqliteDb(dbname='dnsapi'): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): diff --git a/plugins/alist/index.py b/plugins/alist/index.py index 1d0ded778..277920786 100755 --- a/plugins/alist/index.py +++ b/plugins/alist/index.py @@ -115,7 +115,7 @@ def contentReplace(content): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): diff --git a/plugins/cloudreve/index.py b/plugins/cloudreve/index.py index 8f26a8e82..d01cf0865 100755 --- a/plugins/cloudreve/index.py +++ b/plugins/cloudreve/index.py @@ -115,7 +115,7 @@ def contentReplace(content): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): diff --git a/plugins/fail2ban/index.py b/plugins/fail2ban/index.py index 4d478ab10..6d9994da4 100755 --- a/plugins/fail2ban/index.py +++ b/plugins/fail2ban/index.py @@ -147,7 +147,7 @@ def initJailD(): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): @@ -171,7 +171,6 @@ def initDreplace(): systemService = systemDir + '/' + getPluginName() + '.service' if os.path.exists(systemDir) and not os.path.exists(systemService): systemServiceTpl = getPluginDir() + '/init.d/' + getPluginName() + '.service.tpl' - service_path = mw.getServerDir() content = mw.readFile(systemServiceTpl) content = content.replace('{$SERVER_PATH}', service_path) mw.writeFile(systemService, content) diff --git a/plugins/gorse/index.py b/plugins/gorse/index.py index 090c48576..f734ae4b4 100755 --- a/plugins/gorse/index.py +++ b/plugins/gorse/index.py @@ -151,7 +151,7 @@ def contentReplace(content): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): diff --git a/plugins/haproxy/index.py b/plugins/haproxy/index.py index 843ac5090..65812d034 100755 --- a/plugins/haproxy/index.py +++ b/plugins/haproxy/index.py @@ -118,7 +118,7 @@ def status(): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): diff --git a/plugins/keepalived/index.py b/plugins/keepalived/index.py index ecd5e8a80..3ee34712d 100755 --- a/plugins/keepalived/index.py +++ b/plugins/keepalived/index.py @@ -126,7 +126,7 @@ def status(): def contentReplace(content): - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() content = content.replace('{$SERVER_PATH}', service_path) content = content.replace('{$PLUGIN_PATH}', getPluginDir()) @@ -166,7 +166,7 @@ def copyScripts(): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): @@ -202,7 +202,6 @@ def initDreplace(): systemService = systemDir + '/' + getPluginName() + '.service' if os.path.exists(systemDir) and not os.path.exists(systemService): systemServiceTpl = getPluginDir() + '/init.d/' + getPluginName() + '.service.tpl' - service_path = mw.getServerDir() content = mw.readFile(systemServiceTpl) content = contentReplace(content) mw.writeFile(systemService, content) diff --git a/plugins/lvs/index.py b/plugins/lvs/index.py index 82a9f21a3..e1f43e370 100755 --- a/plugins/lvs/index.py +++ b/plugins/lvs/index.py @@ -79,7 +79,7 @@ def status(): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): diff --git a/plugins/mosquitto/index.py b/plugins/mosquitto/index.py index a1ffaf440..5739b1a14 100755 --- a/plugins/mosquitto/index.py +++ b/plugins/mosquitto/index.py @@ -88,7 +88,7 @@ def status(): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): diff --git a/plugins/simpleping/index.py b/plugins/simpleping/index.py index dcc6853f0..6fc8e92fa 100755 --- a/plugins/simpleping/index.py +++ b/plugins/simpleping/index.py @@ -145,7 +145,7 @@ def contentReplace(content): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): @@ -166,7 +166,6 @@ def initDreplace(): systemService = systemDir + '/' + getPluginName() + '.service' if os.path.exists(systemDir) and not os.path.exists(systemService): systemServiceTpl = getPluginDir() + '/init.d/' + getPluginName() + '.service.tpl' - service_path = mw.getServerDir() content = mw.readFile(systemServiceTpl) content = content.replace('{$SERVER_PATH}', service_path) mw.writeFile(systemService, content) diff --git a/plugins/sphinx/index.py b/plugins/sphinx/index.py index 515d94a0a..981a4d4db 100755 --- a/plugins/sphinx/index.py +++ b/plugins/sphinx/index.py @@ -129,7 +129,7 @@ def mkdirAll(): def initDreplace(): file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) + service_path = mw.getServerDir() initD_path = getServerDir() + '/init.d' if not os.path.exists(initD_path): @@ -155,7 +155,6 @@ def initDreplace(): systemService = systemDir + '/sphinx.service' systemServiceTpl = getPluginDir() + '/init.d/sphinx.service.tpl' if os.path.exists(systemDir) and not os.path.exists(systemService): - service_path = mw.getServerDir() se_content = mw.readFile(systemServiceTpl) se_content = se_content.replace('{$SERVER_PATH}', service_path) mw.writeFile(systemService, se_content)