stopWeblogicAdmin.sh.erb 1.3 KB

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