]> source.dussan.org Git - sonarqube.git/commitdiff
fix start.sh and stop.sh on ubuntu with zsh
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 3 Apr 2015 09:05:37 +0000 (11:05 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Tue, 7 Apr 2015 09:27:33 +0000 (11:27 +0200)
moved to bash instead of sh
rewrite testing for existing file and directory so that hopefully it works on both Linux and MacOs

start.sh
stop.sh

index 2b4f1d3ded6c1929cd78a6a7198e9ff46f8b3e90..9c3a25a20cc34895b695e19cf77fe572f0ef3f9f 100755 (executable)
--- a/start.sh
+++ b/start.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 if [[ "$OSTYPE" == "darwin"* ]]; then
   OS='macosx-universal-64'
@@ -6,13 +6,15 @@ else
   OS='linux-x86-64'
 fi
 
-if ! ls sonar-application/target/sonarqube-*.zip &> /dev/null; then
+ls sonar-application/target/sonarqube-*.zip 1> /dev/null 2>&1
+if [ "$?" != "0" ]; then
   echo 'Sources are not built'
   ./build.sh
 fi
 
 cd sonar-application/target/
-if ! ls sonarqube-*/bin/$OS/sonar.sh &> /dev/null; then
+ls sonarqube-*/bin/$OS/sonar.sh 1> /dev/null 2>&1
+if [ "$?" != "0" ]; then
   unzip sonarqube-*.zip
 fi
 cd sonarqube-*
diff --git a/stop.sh b/stop.sh
index 3ddd22de9c151a1164d5aab49b937f351559144f..04eb5b3f10bab48936e0ba5c71e34289ea59f1cd 100755 (executable)
--- a/stop.sh
+++ b/stop.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 # Shortcut to stop server. It must be already built.