
{
    "name"  : "Web认证迁移配置命令是否正确",
    "problems" : {
        "JJ_web" : {
            "desc"      : "【问题】web认证迁移时，每次迁移都需要重新认证。",
            "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 enable eportalv2') > -1:
	if log_run.indexOf('station-move permit')==-1:
		result = 'fail'
		config = config + 'station-move permit ;' 
		restore_cmd.push('config')
		restore_cmd.push('station-move permit')
		restore_cmd.push('end')
	end
	if log_run.indexOf('web-auth station-move auto')==-1:
		result = 'fail'
		config = config + 'web-auth station-move auto ;' 
		restore_cmd.push('config')
		restore_cmd.push('web-auth station-move auto')
		restore_cmd.push('end')
	end
	if log_run.indexOf('web-auth station-move info-update')==-1:
		result = 'fail'
		config = config + 'web-auth station-move info-update ;' 
		restore_cmd.push('config')
		restore_cmd.push('web-auth station-move info-update')
		restore_cmd.push('end')
	end
end
if result =='fail':
	change_title('web认证迁移功能配置错误')
	add_problem('JJ_web',[config],restore_cmd)
    return 'warn'
end
return 'success'

