Skip to content
Snippets Groups Projects
Forked from DM / dm-docs
261 commits behind, 798 commits ahead of the upstream repository.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
dm-ds-services 645 B
#!/bin/sh

# Helper script to start and stop DAQ node services

MY_DIR=`dirname $0` && cd $MYDIR && MYDIR=`pwd`

# The list below defines order of starting/stopping services
startList="postgresql glassfish ds-web-service"
stopList="ds-web-service glassfish postgresql"
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
    $MY_DIR/dm-$service $action 
    sleep 1
done