From 905b0231e93ce2409a45dd6c4f5f983689fdb790 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Wed, 1 Nov 2017 11:56:50 +0800 Subject: Add compass-deck RESTful API and DB Handlers for Compass Change-Id: I1ce411f279943764c286ea48dca9185d453cf254 Signed-off-by: Harry Huang --- compass-deck/bin/compassd | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 compass-deck/bin/compassd (limited to 'compass-deck/bin/compassd') diff --git a/compass-deck/bin/compassd b/compass-deck/bin/compassd new file mode 100755 index 0000000..fc77bb9 --- /dev/null +++ b/compass-deck/bin/compassd @@ -0,0 +1,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 -- cgit 1.2.3-korg