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",