From b9f7d21fda003fb4e6aaa51f90d5ad48f6d1c6b8 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 11 Jun 2022 20:28:30 +0800 Subject: [PATCH] Update index.py --- plugins/varnish/index.py | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/plugins/varnish/index.py b/plugins/varnish/index.py index 91f912625..296904df4 100755 --- a/plugins/varnish/index.py +++ b/plugins/varnish/index.py @@ -65,39 +65,14 @@ def getArgs(): def status(): data = mw.execShell( - "ps -ef|grep redis |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'") + "ps -ef|grep varnish |grep -v grep | grep -v python | grep -v mdserver-web | awk '{print $2}'") if data[0] == '': return 'stop' return 'start' -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 - content = mw.readFile(file_tpl) - content = content.replace('{$SERVER_PATH}', service_path) - mw.writeFile(file_bin, content) - mw.execShell('chmod +x ' + file_bin) - - # config replace - conf_content = mw.readFile(getConfTpl()) - conf_content = conf_content.replace('{$SERVER_PATH}', service_path) - mw.writeFile(getServerDir() + '/redis.conf', conf_content) - - return file_bin - - def start(): - #file = initDreplace() data = mw.execShell('systemctl start ' + getPluginName()) if data[1] == '': return 'ok' @@ -105,7 +80,6 @@ def start(): def stop(): - # file = initDreplace() data = mw.execShell('systemctl stop ' + getPluginName()) if data[1] == '': return 'ok' @@ -113,7 +87,6 @@ def stop(): def restart(): - # file = initDreplace() data = mw.execShell('systemctl restart ' + getPluginName()) log_file = getServerDir() + "/data/redis.log" mw.execShell("echo '' > " + log_file)