
{
    "name"  : "Portal逃生配置命令是否正确",
    "problems" : {
        "JJ_portal" : {
            "desc"      : "【问题】当portal服务器down机时，用户无法认证访问外网。",
            "advice"    : "【建议】增加配置${0}。"
        }
    }
}

---------------------------code-------------------------------
result='pass'
response = get_share_value('log_versionDetail')
if response.indexOf('N18000') == -1 :
	return 'skip'
end
log_run = get_share_value('log_showrun')
if log_run.indexOf('auth-mode gateway') == -1:
	return 'skip'
end
config = ''
restore_cmd = []
reback_cmd = []
if log_run.indexOf('web-auth portal-check interval 3 timeout 3 retransmit 10')==-1:
	result = 'fail'
	config = config + 'web-auth portal-check interval 3 timeout 3 retransmit 10 ;' 
	restore_cmd.push('config')
	restore_cmd.push('web-auth portal-check interval 3 timeout 3 retransmit 10')
	restore_cmd.push('end')
end
if log_run.indexOf('web-auth portal-escape nokick')==-1:
	result = 'fail'
	config = config + 'web-auth portal-escape nokick ;' 
	restore_cmd.push('config')
	restore_cmd.push('web-auth portal-escape nokick')
	restore_cmd.push('end')
end
if result =='fail':
	change_title('Portal逃生功能配置错误')
	add_problem('JJ_portal',[config],restore_cmd)
    return 'warn'
end
return 'success'

