oracle.sh 984 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. tm=`date +%Y%m%d-%H%M%S`
  3. echo "====================================================="
  4. echo "Operating <${tm}>."
  5. echo "====================================================="
  6. echo "Please ensure the config files right."
  7. echo "====================================================="
  8. s_home=$(cd `dirname $0`; pwd)
  9. s_bin=${s_home}/bin
  10. # change to bin dir
  11. cd ${s_bin}
  12. start(){
  13. # 启动前请修改
  14. # IP替换
  15. sh replace.sh 192.168.3.230 192.168.3.230 mysql oracle
  16. if [ $? != 0 ] ; then
  17. exit 1
  18. fi
  19. # 启动容器
  20. sh docker.compose.oracle.up.sh
  21. sh docker.compose.data.up.sh
  22. sh docker.compose.app.up.sh
  23. }
  24. stop(){
  25. sh docker.compose.app.down.sh
  26. sh docker.compose.data.down.sh
  27. sh docker.compose.oracle.down.sh
  28. }
  29. case "$1" in
  30. start)
  31. start
  32. ;;
  33. stop)
  34. stop
  35. ;;
  36. restart|reload)
  37. stop
  38. start
  39. ;;
  40. *)
  41. echo $"Usage: $0 {start|stop|restart}"
  42. exit 1
  43. esac
  44. exit