You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stop.sh 852B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env bash
  2. ###############################
  3. # Shortcut to stop server. It must be already built.
  4. ###############################
  5. set -euo pipefail
  6. ROOT=$(pwd)
  7. source "$ROOT/scripts/editions.sh"
  8. if [ -r "$ROOT/private/scripts/editions.sh" ]; then
  9. source "$ROOT/private/scripts/editions.sh"
  10. fi
  11. if [[ "$OSTYPE" == "darwin"* ]]; then
  12. OS='macosx-universal-64'
  13. else
  14. OS='linux-x86-64'
  15. fi
  16. function stopAny() {
  17. for edition in $EDITIONS; do
  18. SONAR_SH="$(distributionDirOf "$edition")/$(targetDirOf "$edition")/sonarqube-*/bin/$OS/sonar.sh"
  19. if ls $SONAR_SH &> /dev/null; then
  20. echo "$(targetDirOf "$edition") is unpacked"
  21. sh $SONAR_SH stop
  22. fi
  23. done
  24. }
  25. # check the script was called to avoid execute when script is only sourced
  26. script_name=$(basename "$0")
  27. if [ "$script_name" == "stop.sh" ]; then
  28. stopAny
  29. fi