diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2018-05-24 16:00:06 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-06-12 20:20:59 +0200 |
commit | 4264ca3f1c21187231007c084844b223a84137d4 (patch) | |
tree | f2b55ddc65eebcb4e29b535983ad082acb0b70b5 /scripts/stop.sh | |
parent | ded90fa8efaec6c497b066500e1d0f4dc531e4d5 (diff) | |
download | sonarqube-4264ca3f1c21187231007c084844b223a84137d4.tar.gz sonarqube-4264ca3f1c21187231007c084844b223a84137d4.zip |
SONAR-10690 start.sh, stop.sh & logs.sh support SQ editions
Diffstat (limited to 'scripts/stop.sh')
-rwxr-xr-x | scripts/stop.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/stop.sh b/scripts/stop.sh new file mode 100755 index 00000000000..f5da7431230 --- /dev/null +++ b/scripts/stop.sh @@ -0,0 +1,34 @@ +#!/bin/bash +############################### +# Shortcut to stop server. It must be already built. +############################### + +set -euo pipefail + +ROOT=$(pwd) +source "$ROOT/scripts/editions.sh" +if [ -r "$ROOT/private/scripts/editions.sh" ]; then + source "$ROOT/private/scripts/editions.sh" +fi + +if [[ "$OSTYPE" == "darwin"* ]]; then + OS='macosx-universal-64' +else + OS='linux-x86-64' +fi + +function stopAny() { + for edition in $EDITIONS; do + SONAR_SH="$(distributionDirOf "$edition")/$(targetDirOf "$edition")/sonarqube-*/bin/$OS/sonar.sh" + if ls $SONAR_SH &> /dev/null; then + echo "$(targetDirOf "$edition") is unpacked" + sh $SONAR_SH stop + fi + done +} + +# check the script was called to avoid execute when script is only sourced +script_name=$(basename "$0") +if [ "$script_name" == "stop.sh" ]; then + stopAny +fi |