From 7e478f010388830ae68bc469465d4e9446f28259 Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 18 Jun 2022 13:37:38 +0800 Subject: [PATCH] Update index.py --- plugins/openresty/index.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index c1ccbd0cb..37f6c3826 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -202,6 +202,13 @@ def status(): def start(): file = initDreplace() + + if not mw.isAppleSystem(): + data = mw.execShell('systemctl start openresty') + if data[1] == '': + return 'ok' + return 'fail' + data = mw.execShell(file + ' start') if data[1] == '': return 'ok' @@ -210,6 +217,13 @@ def start(): def stop(): file = initDreplace() + + if not mw.isAppleSystem(): + data = mw.execShell('systemctl stop openresty') + if data[1] == '': + return 'ok' + return 'fail' + data = mw.execShell(file + ' stop') clearTemp() if data[1] == '': @@ -219,6 +233,13 @@ def stop(): def restart(): file = initDreplace() + + if not mw.isAppleSystem(): + data = mw.execShell('systemctl restart openresty') + if data[1] == '': + return 'ok' + return 'fail' + data = mw.execShell(file + ' restart') if data[1] == '': return 'ok' @@ -227,6 +248,13 @@ def restart(): def reload(): file = initDreplace() + + if not mw.isAppleSystem(): + data = mw.execShell('systemctl reload openresty') + if data[1] == '': + return 'ok' + return 'fail' + data = mw.execShell(file + ' reload') if data[1] == '': return 'ok'