sql.append("INSERT INTO settings (param, value, section, `desc`) values('nginx_stats_user', 'admin', 'nginx', 'Username for Stats web page Nginx');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('nginx_stats_password', 'password', 'nginx', 'Password for Stats web page Nginx');")
@ -395,6 +397,7 @@ def update_db_v_4(**kwargs):
sql.append("INSERT INTO settings (param, value, section, `desc`) values('nginx_status_command', 'systemctl status nginx', 'nginx', 'Command for status check Nginx service');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('nginx_dir', '/etc/nginx/conf.d/', 'nginx', 'Path to Nginx dir');")
sql.append("INSERT INTO settings (param, value, section, `desc`) values('nginx_config_path', '/etc/nginx/conf.d/default.conf', 'nginx', 'Path to Nginx config');")
sql.append("update `servers` set `haproxy` = '1';")
foriinsql:
try:
cur.execute(i)
@ -411,27 +414,30 @@ def update_db_v_4(**kwargs):
defupdate_db_v_41(**kwargs):
con,cur=get_cur()
sql=list()
sql.append("update settings set section = 'main', `desc` = 'Temp store configs, for check' where param = 'tmp_config_path';")
sql.append("update settings set section = 'main' where param = 'cert_path';")
sql=""" select * from servers where enable = 1 %s%s%s"""%(disable,type_ip,nginx)
else:
sql=""" select * from servers where groups like '%{group}%' and (enable = 1 {disable}) {type_ip}{ip}{nginx}""".format(group=group[5],disable=disable,type_ip=type_ip,ip=ip,nginx=nginx)
sql=""" select * from servers where groups like '%{group}%' and (enable = 1 {disable}) {type_ip}{ip}{haproxy}{nginx}