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 849B

1234567891011121314151617181920212223242526272829303132
  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. source "$ROOT/scripts/os.sh"
  9. if [ -r "$ROOT/private/scripts/editions.sh" ]; then
  10. source "$ROOT/private/scripts/editions.sh"
  11. fi
  12. stopAny() {
  13. # Don't try to stop on windows for now
  14. if [[ "${OSTYPE:-}" != "msys" ]]; then
  15. for edition in $EDITIONS; do
  16. SONAR_SH="$(distributionDirOf "$edition")/sonarqube-*/bin/$OS_DIR/sonar.sh"
  17. if ls $SONAR_SH &> /dev/null; then
  18. echo "$(baseFileNameOf "$edition") is unpacked"
  19. sh $SONAR_SH stop
  20. fi
  21. done
  22. fi
  23. }
  24. # check the script was called to avoid execute when script is only sourced
  25. script_name=$(basename "$0")
  26. if [ "$script_name" = "stop.sh" ]; then
  27. stopAny
  28. fi