@echo on

echo rollback ATIC begin...

if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\ (

	copy /Y .\backup\atic.cbb.ireport-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\atic.cbb.ireport-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\atic.ireport.adapter-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\atic.ireport.adapter-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.auth.encrypt-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.auth.encrypt-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.cloudclean-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.cloudclean-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.dashboard-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.dashboard-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.diversion-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.diversion-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.fault-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.fault-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.internal-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.internal-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.log-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.log-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.neglobal-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.neglobal-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.packetcapture-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.packetcapture-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.policy-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.policy-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.report-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.report-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.secne-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.secne-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.cbb.server-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.cbb.server-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.core.base-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.core.base-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.core.log-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.core.log-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.system.common-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.system.common-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.system.dump-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.system.dump-0.0.1-SNAPSHOT.jar
	copy /Y .\backup\com.huawei.atic.unicom.soc-0.0.1-SNAPSHOT.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\com.huawei.atic.unicom.soc-0.0.1-SNAPSHOT.jar
	
	if exist .\backup_jar\xmlschema-core-2.2.4.jar (
		copy /Y .\backup_jar\xmlschema-core-2.2.4.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib
		copy /Y .\backup_jar\javax.annotation-api-1.3.1.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib
		copy /Y .\backup_jar\cxf-core-3.3.1.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib
		copy /Y .\backup_jar\cxf-rt-frontend-jaxrs-3.3.1.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib
		copy /Y .\backup_jar\cxf-rt-transports-http-3.3.1.jar .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib
	)
	
	if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\xmlschema-core-2.2.4.jar (
		if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\xmlschema-core-2.2.5.jar (
			del .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\xmlschema-core-2.2.5.jar 
			del .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\javax.annotation-api-1.3.2.jar
			del .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\cxf-core-3.3.5.jar
			del .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\cxf-rt-frontend-jaxrs-3.3.5.jar
			del .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\lib\cxf-rt-transports-http-3.3.5.jar
		)
	)
)

if exist .\..\Runtime\vsm_conf\antiddos\ (
	copy /Y .\backup\attackIpConfig.xml .\..\Runtime\vsm_conf\antiddos\attackIpConfig.xml
	copy /Y .\backup\unicom.xml .\..\Runtime\vsm_conf\antiddos\unicom\unicom.xml
)
if exist .\..\Runtime\vsm_conf\policy\policy.xml (
	del .\..\Runtime\vsm_conf\policy\policy.xml
)
if exist .\..\Runtime\vsm_conf\policy\autoSecDownload.conf (
	del .\..\Runtime\vsm_conf\policy\autoSecDownload.conf
)
if exist .\..\Runtime\LegoRuntime\conf\ (
	copy /Y .\backup\LegoRuntime\version.txt .\..\Runtime\LegoRuntime\conf\version.txt
)
if exist .\..\antiddos_collector\conf\ (
	copy /Y .\backup\antiddos_collector\version.txt .\..\antiddos_collector\conf\version.txt
)
if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\help\ (
	rmdir /s/q .\..\Runtime\Tomcat6\Lego-UI-Plat\help\
	xcopy /Y /E /Q .\backup\help .\..\Runtime\Tomcat6\Lego-UI-Plat\help\ >nul
)
if exist .\..\antiddos_collector\lib\ (
	copy /Y .\backup\com.huawei.atic.collector-0.0.1-SNAPSHOT.jar .\..\antiddos_collector\lib\com.huawei.atic.collector-0.0.1-SNAPSHOT.jar
)
if exist .\..\vsm_ha_server\lib\ (
	copy /Y .\backup\ha.jar .\..\vsm_ha_server\lib\ha.jar
)
if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\config\spring\ (
	copy /Y .\backup\spring\applicationContext.xml .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\config\spring\applicationContext.xml
	copy /Y .\backup\spring\applicationContext-Restful.xml .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\config\spring\applicationContext-Restful.xml
)
if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\iReport\iReportBiz\reportPlugins\ (
	rmdir /s/q .\..\Runtime\Tomcat6\Lego-UI-Plat\iReport\iReportBiz\reportPlugins\
	xcopy /Y /E /Q .\backup\reportPlugins .\..\Runtime\Tomcat6\Lego-UI-Plat\iReport\iReportBiz\reportPlugins\ >nul
)
if exist .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\pages\iReport\reportui\report\ (
	rmdir /s/q .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\pages\iReport\reportui\report\
	xcopy /Y /E /Q .\backup\report .\..\Runtime\Tomcat6\Lego-UI-Plat\WEB-INF\pages\iReport\reportui\report\ >nul
)
if exist .\..\Runtime\Tomcat6\webapps\portal\ (
	rmdir /s/q .\..\Runtime\Tomcat6\webapps\portal\
	xcopy /Y /E /Q .\backup\portal .\..\Runtime\Tomcat6\webapps\portal\ >nul
)
if exist .\..\vsm_ha_server\VSMHAService.bat (
	copy /Y .\backup\vsm_ha_server\VSMHAService.bat .\..\vsm_ha_server\VSMHAService.bat
)

echo rollback ATIC finished.

@echo off