summaryrefslogtreecommitdiffstats
path: root/compass-deck/bin/compassd
blob: fc77bb9ad5defef4f1299ba1092ebfee198451d6 (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
#!/bin/sh

RETVAL_CELERY=0
RETVAL_PROGRESS_UPDATE=0
start() {
    service compass-celeryd start
    RETVAL_CELERY=$?
    service compass-progress-updated start
    RETVAL_PROGRESS_UPDATE=$?
}

stop() {
    service compass-celeryd stop
    RETVAL_CELERY=$?
    service compass-progress-updated stop
    RETVAL_PROGRESS_UPDATE=$?
}

restart() {
   stop
   start
}
case "$1" in
    start|stop|restart)
        $1
        ;;
    status)
        service compass-celeryd status
        RETVAL_CELERY=$?
        service compass-progress-updated status
        RETVAL_PROGRESS_UPDATE=$?
        ;;
    *)
        echo "Usage: $0 {start|stop|status|restart}"
        exit 1
        ;;
esac
if [[ "$RETVAL_CELERY" != "0" ]]; then
    exit $RETVAL_CELERY
fi
if [[ "$RETVAL_PROGRESS_UPDATE" != "0" ]]; then
    exit $RETVAL_PROGRESS_UPDATE
fi