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