Skip to content
Snippets Groups Projects
dm-daq-services 681 B
Newer Older
sveseli's avatar
sveseli committed
#!/bin/sh

# Helper script to start and stop DAQ node services

sveseli's avatar
sveseli committed
MY_DIR=`dirname $0` && cd $MYDIR && MYDIR=`pwd`
sveseli's avatar
sveseli committed

# The list below defines order of starting/stopping services
startList="mongodb mongo-express daq-web-service cat-web-service"
stopList="cat-web-service daq-web-service mongo-express mongodb"
restartList=$startList
statusList=$startList

# Check action
action=$1
case $action in
    start|stop|restart|status)
    ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart}"
        exit 1
esac

# Perform action
serviceList="\$"${action}List
serviceList=`eval "echo $serviceList"`
for service in $serviceList; do
sveseli's avatar
sveseli committed
    $MY_DIR/dm-$service $action 
sveseli's avatar
sveseli committed
    sleep 1
done