防火墙安装自动化
This commit is contained in:
parent
6c8790b915
commit
1ac89246a4
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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':
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
"type":"其他插件",
|
||||
"ps":"轻量级,占有内存少,并发能力强",
|
||||
"shell":"install.sh",
|
||||
"install_pre_inspection":true,
|
||||
"checks":"server/openresty",
|
||||
"path":"server/openresty",
|
||||
"author":"agentzh",
|
||||
|
|
|
|||
Loading…
Reference in New Issue