startWeblogicAdmin.sh.erb 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 "Starting Weblogic ${wlsAdminServer} for domain ${osDomain}...."
  17. echo "Checking if Weblogic ${wlsAdminServer} for domain ${osDomain} is already started...."
  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. echo "The Weblogic ${wlsAdminServer} for domain ${osDomain} is already running...."
  30. echo "Server NOT started again...."
  31. else
  32. if [[ ${nodePid} ]]
  33. then
  34. echo "The Weblogic ${wlsAdminServer} for domain ${osDomain} is not running...."
  35. echo "Starting Weblogic ${wlsAdminServer} for domain ${osDomain}...."
  36. $osWlHome/common/bin/wlst.sh <<-EOF
  37. nmConnect('${user}','${password}','${hostname}','${nodeMgrPort}','${osDomain}','${osDomainPath}','ssl')
  38. nmStart('${wlsAdminServer}')
  39. nmServerStatus('${wlsAdminServer}')
  40. nmDisconnect()
  41. EOF
  42. echo "The Weblogic ${wlsAdminServer} for domain ${osDomain} is starting...."
  43. else
  44. echo "NodeManager is not running on this machine ${hostname}"
  45. echo "Start the NodeManager first"
  46. fi
  47. fi
  48. echo "Done...."