From 1ac89246a45a0a2ed564a67b9693f59bd5da538a Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 11 Aug 2022 23:49:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E7=81=AB=E5=A2=99=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/op_waf/install.sh | 4 ++-- plugins/openresty/index.py | 8 ++++++++ plugins/openresty/info.json | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/op_waf/install.sh b/plugins/op_waf/install.sh index 35a36768a..481fbd07c 100755 --- a/plugins/op_waf/install.sh +++ b/plugins/op_waf/install.sh @@ -19,12 +19,12 @@ Install_of(){ echo '0.1' > $serverPath/op_waf/version.pl echo 'install ok' > $install_tmp - cd ${rootPath} && python3 ${rootPath}/plugins/op_waf/index.py start + cd ${rootPath} && python3 plugins/op_waf/index.py start } Uninstall_of(){ - cd ${rootPath} && python3 ${rootPath}/plugins/op_waf/index.py stop + cd ${rootPath} && python3 plugins/op_waf/index.py stop rm -rf $serverPath/op_waf } diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index 8fe7e0386..5d58ef5c4 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -296,6 +296,12 @@ def errorLogPath(): return getServerDir() + '/nginx/logs/error.log' +def installPreInspection(): + check_op = mw.getServerDir() + "/openresty" + if not os.path.exists(check_op): + return "请先安装OpenResty" + return 'ok' + if __name__ == "__main__": func = sys.argv[1] if func == 'status': @@ -314,6 +320,8 @@ if __name__ == "__main__": print(initdInstall()) elif func == 'initd_uninstall': print(initdUinstall()) + elif func == 'install_pre_inspection': + print(installPreInspection()) elif func == 'conf': print(getConf()) elif func == 'get_os': diff --git a/plugins/openresty/info.json b/plugins/openresty/info.json index 606fdc769..7ec66ae27 100755 --- a/plugins/openresty/info.json +++ b/plugins/openresty/info.json @@ -5,6 +5,7 @@ "type":"其他插件", "ps":"轻量级,占有内存少,并发能力强", "shell":"install.sh", + "install_pre_inspection":true, "checks":"server/openresty", "path":"server/openresty", "author":"agentzh",