Fixes
This commit is contained in:
34
usr/local/mgr5/addon/nginx_form_rewrite_plugin.py
Normal file
34
usr/local/mgr5/addon/nginx_form_rewrite_plugin.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import xml.etree.ElementTree as etree
|
||||
from sys import stdin
|
||||
|
||||
import re
|
||||
|
||||
def check_nginx_rewrite_module():
|
||||
config_path = "/usr/share/nginx/modules/ngx_http_apache_rewrite_module.conf"
|
||||
if not os.path.exists(config_path):
|
||||
return False
|
||||
pattern = re.compile(r'^\s*load_module\s+"\/usr\/lib64\/nginx\/modules\/ngx_http_apache_rewrite_module.so";\s*$')
|
||||
with open(config_path, 'r') as f:
|
||||
for line in f:
|
||||
stripped = line.lstrip()
|
||||
if stripped.startswith('#'):
|
||||
continue
|
||||
if pattern.match(line):
|
||||
return True
|
||||
return False
|
||||
|
||||
if __name__ == "__main__":
|
||||
root = etree.parse(stdin).getroot()
|
||||
|
||||
func = os.getenv('PARAM_func')
|
||||
|
||||
if func == 'nginx_mod_rewrite_plugin_menu_settings':
|
||||
nginx_mod_rewrite_plugin_menu_module_enable = os.getenv("PARAM_nginx_mod_rewrite_plugin_menu_module_enable")
|
||||
|
||||
|
||||
|
||||
etree.dump(root)
|
||||
quit(0)
|
||||
Reference in New Issue
Block a user