Guest User

Untitled

a guest
Feb 27th, 2020
283
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. function check_wls {
  3. action=$1
  4. host=$2
  5. admin_port=$3
  6. sleeptime=$4
  7. while true
  8. do
  9. sleep ${sleeptime}
  10. if [ "$action" == "started" ]; then
  11. started_url="http://$host:$admin_port/weblogic/ready"
  12. echo -e "[Provisioning Script] Waiting for WebLogic server to get $action, checking $started_url"
  13. status=`/usr/bin/curl -s -i $started_url | grep "200 OK"`
  14. echo "[Provisioning Script] Status:" $status
  15. if [ ! -z "$status" ]; then
  16. break
  17. fi
  18. elif [ "$action" == "shutdown" ]; then
  19. shutdown_url="http://$host:$admin_port"
  20. echo -e "[Provisioning Script] Waiting for WebLogic server to get $action, checking $shutdown_url"
  21. status=`/usr/bin/curl -s -i $shutdown_url | grep "500 Can't connect"`
  22. if [ ! -z "$status" ]; then
  23. break
  24. fi
  25. fi
  26. done
  27. echo -e "[Provisioning Script] WebLogic Server has $action"
  28. }
  29.  
  30. . $DOMAIN_HOME/bin/setDomainEnv.sh
  31.  
  32. echo 'Changing current directory to ' $DOMAIN_HOME
  33. cd $DOMAIN_HOME
  34.  
  35. echo 'Setting environment variable for username and password '
  36. export EXTRA_JAVA_PROPERTIES="-Dweblogic.management.username=$ADMIN_USERNAME -Dweblogic.management.password=$ADMIN_PASSWORD"
  37.  
  38. echo 'Running Admin Server in background'
  39. bin/startWebLogic.sh &
  40.  
  41. echo 'Waiting for Admin Server to reach RUNNING state'
  42. check_wls "started" "localhost" "$ADMIN_LISTEN_PORT" "2s"
RAW Paste Data