stopWeblogicAdmin.sh.erb 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!<%= @shell %>
  2. # *************************************************************************
  3. osWlHome=<%= @osWlHome %>
  4. osDomain=<%= @osDomain %>
  5. osDomainPath=<%= @osDomainPath %>
  6. nodeMgrPort=<%= @nodeMgrPort %>
  7. hostname=<%= @nodeMgrAddress %>
  8. user=<%= @wlsUser %>
  9. password=<%= @wlsPassword %>
  10. wlsAdminServer=<%= @wlsAdminServer %>
  11. <% if @jsseEnabled == true %>
  12. export CONFIG_JVM_ARGS='-Dweblogic.ssl.JSSEEnabled=true -Dweblogic.security.SSL.enableJSSE=true <%= @trust_env %>'
  13. <% else %>
  14. export CONFIG_JVM_ARGS='-Dweblogic.ssl.JSSEEnabled=false -Dweblogic.security.SSL.enableJSSE=false <%= @trust_env %>'
  15. <% end %>
  16. echo "Stopping Weblogic ${wlsAdminServer} for domain ${osDomain}...."
  17. echo "Checking if Weblogic ${wlsAdminServer} for domain ${osDomain} is up...."
  18. echo "CONFIG_JVM_ARGS ${CONFIG_JVM_ARGS}"
  19. unamestr=`uname`
  20. if [[ "$unamestr" == 'SunOS' ]]; then
  21. checkStmt='/usr/ucb/ps wwxa'
  22. else
  23. checkStmt='/bin/ps -eo pid,cmd'
  24. fi
  25. pid=`${checkStmt} | /bin/grep -i ${wlsAdminServer} | /bin/grep -i ${osDomain} | /bin/grep -v grep | awk '{print $1}'`
  26. nodePid=`${checkStmt} | /bin/grep -i nodemanager.javahome | /bin/grep -v grep | awk '{print $1}'`
  27. if [[ ${pid} ]]
  28. then
  29. if [[ ${nodePid} ]]
  30. then
  31. echo "The Weblogic ${wlsAdminServer} for domain ${osDomain} is running.. Stopping ${wlsAdminServer} NOW...."
  32. $osWlHome/common/bin/wlst.sh <<-EOF
  33. nmConnect('${user}','${password}','${hostname}','${nodeMgrPort}','${osDomain}','${osDomainPath}','ssl')
  34. nmKill('${wlsAdminServer}')
  35. nmDisconnect()
  36. EOF
  37. else
  38. echo "NodeManager is not running on this machine ${hostname}"
  39. echo "Start the NodeManager first"
  40. fi
  41. else
  42. echo "The Weblogic ${wlsAdminServer} for domain ${osDomain} is NOT running...."
  43. fi
  44. echo "Done...."