From a0b362e691f036e3565acba2214a00b7c9d31e6e Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 2 May 2023 11:31:25 +0800 Subject: [PATCH] Update index.py --- plugins/docker/index.py | 52 ++--------------------------------------- 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/plugins/docker/index.py b/plugins/docker/index.py index 90d0295ca..7bae1df0e 100755 --- a/plugins/docker/index.py +++ b/plugins/docker/index.py @@ -77,65 +77,17 @@ def status(): def initDreplace(): - - file_tpl = getInitDTpl() - service_path = os.path.dirname(os.getcwd()) - - initD_path = getServerDir() + '/init.d' - if not os.path.exists(initD_path): - os.mkdir(initD_path) - # file_bin = initD_path + '/' + getPluginName() - - # initd replace - # if not os.path.exists(file_bin): - # content = mw.readFile(file_tpl) - # content = content.replace('{$SERVER_PATH}', service_path) - # mw.writeFile(file_bin, content) - # mw.execShell('chmod +x ' + file_bin) - - # log - # dataLog = getServerDir() + '/data' - # if not os.path.exists(dataLog): - # mw.execShell('chmod +x ' + file_bin) - - # # config replace - # dst_conf = getServerDir() + '/redis.conf' - # dst_conf_init = getServerDir() + '/init.pl' - # if not os.path.exists(dst_conf_init): - # conf_content = mw.readFile(getConfTpl()) - # conf_content = conf_content.replace('{$SERVER_PATH}', service_path) - # conf_content = conf_content.replace( - # '{$REDIS_PASS}', mw.getRandomString(10)) - - # mw.writeFile(dst_conf, conf_content) - # mw.writeFile(dst_conf_init, 'ok') - - # # systemd - # systemDir = mw.systemdCfgDir() - # systemService = systemDir + '/redis.service' - # systemServiceTpl = getPluginDir() + '/init.d/redis.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) - # mw.execShell('systemctl daemon-reload') - - return file_bin + return '' def dockerOp(method): file = initDreplace() if not mw.isAppleSystem(): - data = mw.execShell('systemctl ' + method + ' redis') + data = mw.execShell('systemctl ' + method + ' docker') if data[1] == '': return 'ok' return data[1] - - data = mw.execShell(file + ' start') - if data[1] == '': - return 'ok' return 'fail'