wls-basic-measurement.cmd 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. @echo off
  2. setlocal
  3. setlocal EnableDelayedExpansion
  4. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  5. :: wls-basic-measurement.cmd v19.1
  6. :: - Invoke WLS Basic feature usage script. Connects to a running WLS server and
  7. :: returns WLS Basic feature usage information.
  8. :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  9. :: init variables
  10. set SCRIPT_VERSION=19.1(%CT_BUILD_VERSION%)
  11. set PYFILE=..\resources\util\WLST\WLSBasic\wls-basic-measurement.py
  12. set COMPARE_RESULT_FILE=compare_result.txt
  13. echo. > %COMPARE_RESULT_FILE%
  14. set INPUTSETUP=
  15. :: check to see if Collection Tool is running, if it is, don't print the license prompt again
  16. tasklist /v | findstr /C:"Collection Tool"
  17. echo er %errorlevel%
  18. if errorlevel 1 (
  19. goto printLicense
  20. ) else ( goto checkInput )
  21. :printLicense
  22. set PYFILE=.\wls-basic-measurement.py
  23. more ..\..\license_agreement.txt
  24. :promptloop
  25. set /p ANSWER=Accept License Agreement? (y\n\q)
  26. if "%ANSWER%"=="y" (
  27. goto checkInput
  28. ) else if "%ANSWER%"=="n" (
  29. goto licagreement
  30. ) else if "%ANSWER%"=="q" (
  31. goto licagreement
  32. ) else ( goto promptloop )
  33. :licagreement
  34. echo.
  35. echo You cannot run this program without agreeing to the license agreement.
  36. goto endwls-basic-measurement
  37. :checkInput
  38. set "WLS_LICAGREE=!LICAGREE!"
  39. if "%WLS_LICAGREE%" == "True" (
  40. goto endgetWLS_NUP
  41. )
  42. if "%INPUTSETUP%"=="q" (
  43. echo QUIT_WLST=q> %COMPARE_RESULT_FILE%
  44. goto endwls-basic-measurement
  45. )
  46. set MACHINE_NAME=%COMPUTERNAME%
  47. set COMMANDLINE=
  48. :getpMW_HOME
  49. set pMW_HOME=
  50. :getMW_HOME
  51. set MW_HOME=%MW_HOME%
  52. :promptMW_HOME
  53. if NOT "%pMW_HOME%" == "" set MW_HOME=%pMW_HOME%
  54. if "%MW_HOME%"=="q" (
  55. echo User chose to quit wls-basic-measurement.
  56. echo QUIT_WLST=q> %COMPARE_RESULT_FILE%
  57. goto endwls-basic-measurement
  58. )
  59. if "%MW_HOME%"=="quit" (
  60. echo User chose to quit wls-basic-measurement.
  61. echo QUIT_WLST=q> %COMPARE_RESULT_FILE%
  62. goto endwls-basic-measurement
  63. )
  64. if "%MW_HOME%"=="Q" (
  65. echo User chose to quit wls-basic-measurement.
  66. echo QUIT_WLST=q> %COMPARE_RESULT_FILE%
  67. goto endwls-basic-measurement
  68. )
  69. if not exist "%MW_HOME%\oracle_common\common\bin\wlst.cmd" (
  70. echo Directory %MW_HOME%\oracle_common\common\bin does not exist or contain wlst.cmd.
  71. echo "Please enter the MW_HOME location where WebLogic is installed"
  72. set /p pMW_HOME=or to quit the WebLogic Basic script, enter [quit or q]:
  73. goto getMW_HOME
  74. )
  75. REM SETLOCAL
  76. if exist "%MW_HOME%\wlserver\server\bin\setWLSEnv.cmd" (
  77. CALL "%MW_HOME%\wlserver\server\bin\setWLSEnv.cmd"
  78. )
  79. if exist "%MW_HOME%\wlserver_10.3\server\bin\setWLSEnv.cmd" (
  80. CALL "%MW_HOME%\wlserver\server\bin\setWLSEnv.cmd"
  81. )
  82. set CLASSPATH=%CLASSPATH%;%MW_HOME%\server\lib\wlst.jar;%MW_HOME%\server\lib\jython.jar;
  83. @echo off
  84. :: setup output dir
  85. if not exist "%CT_TMP%\WLSBasic" (
  86. md %CT_TMP%\WLSBasic
  87. )
  88. "%MW_HOME%\oracle_common\common\bin\wlst.cmd" %PYFILE% %COMPUTERNAME%
  89. :endwls-basic-measurement
  90. @endlocal
  91. ENDLOCAL