summaryrefslogtreecommitdiffstats
path: root/development/sonarqube/rc.sonarqube
blob: 63b82f486cad39ef35e31ab790725f70a4086c81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh

PIDDIR="/var/run/sonarqube"
RUNAS="sonar"
SCRIPT="/sbin/sonar.sh"
export SONAR_JAVA_PATH="/usr/lib64/java/bin/java"

case "$1" in

    'console')
        su ${RUNAS} -c "PIDDIR=${PIDDIR} ${SCRIPT} $*"
        ;;

    'start')
        su ${RUNAS} -c "PIDDIR=${PIDDIR} ${SCRIPT} $*"
        ;;

    'stop')
        su ${RUNAS} -c "PIDDIR=${PIDDIR} ${SCRIPT} $*"
        ;;

    'force-stop')
        su ${RUNAS} -c "PIDDIR=${PIDDIR} ${SCRIPT} $*"
        ;;

    'restart')
        su ${RUNAS} -c "PIDDIR=${PIDDIR} ${SCRIPT} $*"
        ;;

    'status')
        su ${RUNAS} -c "PIDDIR=${PIDDIR} ${SCRIPT} $*"
        ;;

    'dump')
        su ${RUNAS} -c "PIDDIR=${PIDDIR} ${SCRIPT} $*"
        ;;

    *)
        echo "Usage: $0 { console | start | stop | force-stop | restart | status | dump }"
        exit 1
        ;;
esac

exit 0