stopWeblogicAdmin.sh.erb 1.6 KB

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