getWLS_NUP.cmd 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. @echo off
  2. setlocal
  3. setlocal EnableDelayedExpansion
  4. :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  5. :: getWLS_NUP.cmd v 19.1
  6. :: - Look for WebLogic authorized users.
  7. :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  8. :: init variables
  9. set SCRIPT_VERSION=19.1(%CT_BUILD_VERSION%)
  10. set PYFILE=..\resources\util\WLST\WLSNUP\getWLS_nup.py
  11. set COMPARE_RESULT_FILE=compare_result.txt
  12. echo. > %COMPARE_RESULT_FILE%
  13. set INPUTSETUP=
  14. :: check to see if Collection Tool is running, if it is, don't print the license prompt again
  15. tasklist /v | findstr /C:"Collection Tool"
  16. echo er %errorlevel%
  17. if errorlevel 1 (
  18. goto printLicense
  19. ) else ( goto checkInput )
  20. :printLicense
  21. :: init variables
  22. set PYFILE=.\getWLS_nup.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 endgetWLS_NUP
  37. :checkInput
  38. set "WLS_LICAGREE=!LICAGREE!"
  39. if "%WLS_LICAGREE%" == "True" (
  40. goto endgetWLS_NUP
  41. )
  42. set MACHINE_NAME=%COMPUTERNAME%
  43. set COMMANDLINE=
  44. :getpMW_HOME
  45. set pMW_HOME=
  46. :promptMW_HOME
  47. if "%pMW_HOME%" NEQ "" set MW_HOME=%pMW_HOME%
  48. if "%MW_HOME%"=="q" (
  49. echo User chose to quit getWLS_NUP.
  50. echo QUIT_WLST=q> %COMPARE_RESULT_FILE%
  51. goto endgetWLS_NUP
  52. )
  53. if "%MW_HOME%"=="quit" (
  54. echo User chose to quit getWLS_NUP.
  55. echo QUIT_WLST=q> %COMPARE_RESULT_FILE%
  56. goto endgetWLS_NUP
  57. )
  58. if "%MW_HOME%"=="Q" (
  59. echo User chose to quit getWLS_NUP.
  60. echo QUIT_WLST=q> %COMPARE_RESULT_FILE%
  61. goto endgetWLS_NUP
  62. )
  63. if not exist "%MW_HOME%\oracle_common\common\bin\wlst.cmd" (
  64. echo Directory %MW_HOME%\oracle_common\common\bin does not exist or contain wlst.cmd.
  65. echo "Please enter the MW_HOME location where WebLogic is installed"
  66. set /p pMW_HOME=or to quit the WebLogic NUP script, enter [quit or q]:
  67. goto promptMW_HOME
  68. )
  69. REM SETLOCAL
  70. if exist "%MW_HOME%\wlserver\server\bin\setWLSEnv.cmd" (
  71. CALL "%MW_HOME%\wlserver\server\bin\setWLSEnv.cmd"
  72. )
  73. if exist "%MW_HOME%\wlserver_10.3\server\bin\setWLSEnv.cmd" (
  74. CALL "%MW_HOME%\wlserver\server\bin\setWLSEnv.cmd"
  75. )
  76. set CLASSPATH=%CLASSPATH%;%MW_HOME%\server\lib\wlst.jar;%MW_HOME%\server\lib\jython.jar;
  77. @echo Getting WLS Domain NUP ...
  78. @echo off
  79. :: setup output dir
  80. if not exist "%CT_TMP%\WLSNUP" (
  81. md %CT_TMP%\WLSNUP
  82. )
  83. "%MW_HOME%\oracle_common\common\bin\wlst.cmd" %PYFILE% %COMPUTERNAME%
  84. :endgetWLS_NUP
  85. @endlocal
  86. ENDLOCAL