防火墙安装自动化

pull/157/head
midoks 3 years ago
parent 6c8790b915
commit 1ac89246a4
  1. 4
      plugins/op_waf/install.sh
  2. 8
      plugins/openresty/index.py
  3. 1
      plugins/openresty/info.json

@ -19,12 +19,12 @@ Install_of(){
echo '0.1' > $serverPath/op_waf/version.pl echo '0.1' > $serverPath/op_waf/version.pl
echo 'install ok' > $install_tmp 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(){ 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 rm -rf $serverPath/op_waf
} }

@ -296,6 +296,12 @@ def errorLogPath():
return getServerDir() + '/nginx/logs/error.log' 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__": if __name__ == "__main__":
func = sys.argv[1] func = sys.argv[1]
if func == 'status': if func == 'status':
@ -314,6 +320,8 @@ if __name__ == "__main__":
print(initdInstall()) print(initdInstall())
elif func == 'initd_uninstall': elif func == 'initd_uninstall':
print(initdUinstall()) print(initdUinstall())
elif func == 'install_pre_inspection':
print(installPreInspection())
elif func == 'conf': elif func == 'conf':
print(getConf()) print(getConf())
elif func == 'get_os': elif func == 'get_os':

@ -5,6 +5,7 @@
"type":"其他插件", "type":"其他插件",
"ps":"轻量级,占有内存少,并发能力强", "ps":"轻量级,占有内存少,并发能力强",
"shell":"install.sh", "shell":"install.sh",
"install_pre_inspection":true,
"checks":"server/openresty", "checks":"server/openresty",
"path":"server/openresty", "path":"server/openresty",
"author":"agentzh", "author":"agentzh",

Loading…
Cancel
Save